Refactor Dockerfile to unify base image references and improve clarity in build stages
All checks were successful
Building and publishing Homebrewery as Docker Image / build (release) Successful in 11m48s
All checks were successful
Building and publishing Homebrewery as Docker Image / build (release) Successful in 11m48s
This commit is contained in:
parent
4b6efcea6e
commit
9960e05315
11
Dockerfile
11
Dockerfile
@ -1,24 +1,27 @@
|
||||
# Base Stage for NodeJS
|
||||
FROM node:22-alpine AS base
|
||||
FROM --platform=$BUILDPLATFORM node:22-alpine AS buildhelper
|
||||
|
||||
ENV NODE_ENV=docker
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Installing dependencies with use of package-lock.json
|
||||
FROM base AS deps
|
||||
FROM buildhelper AS deps
|
||||
|
||||
RUN apk --no-cache add git
|
||||
COPY homebrewery/package.json homebrewery/package-lock.json ./
|
||||
RUN npm ci --ignore-scripts
|
||||
|
||||
# Build Stage
|
||||
FROM base AS builder
|
||||
FROM buildhelper AS builder
|
||||
|
||||
COPY --from=deps /usr/src/app/node_modules ./node_modules
|
||||
COPY homebrewery/ ./
|
||||
RUN npm run build
|
||||
|
||||
FROM base AS runner
|
||||
FROM --platform=$TARGETPLATFORM node:22-alpine AS runner
|
||||
|
||||
ENV NODE_ENV=docker
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
ARG VERSION
|
||||
ARG REVISION
|
||||
|
Loading…
x
Reference in New Issue
Block a user