Fix quick dockerfile
All checks were successful
Build release Docker image / Build Docker Images (push) Successful in 5m29s
All checks were successful
Build release Docker image / Build Docker Images (push) Successful in 5m29s
This commit is contained in:
14
Dockerfile
14
Dockerfile
@@ -10,9 +10,11 @@ WORKDIR /opt/app
|
||||
COPY package.json yarn.lock ./
|
||||
RUN yarn install --frozen-lockfile
|
||||
COPY . .
|
||||
|
||||
# On force le build de l'admin explicitement pour être sûr que le dossier existe
|
||||
RUN yarn build
|
||||
|
||||
# --- ÉTAPE 2 : RUNTIME (L'image finale) ---
|
||||
# --- ÉTAPE 2 : RUNTIME ---
|
||||
FROM node:20-alpine AS runtime-stage
|
||||
RUN apk add --no-cache vips-dev libpng libjpeg-turbo
|
||||
|
||||
@@ -21,13 +23,9 @@ ENV NODE_ENV=${NODE_ENV}
|
||||
|
||||
WORKDIR /opt/app
|
||||
|
||||
# ASTUCE : On copie et on change le propriétaire EN MÊME TEMPS
|
||||
# On ne prend que ce qui est utile pour l'exécution
|
||||
COPY --from=build-stage --chown=node:node /opt/app/node_modules ./node_modules
|
||||
COPY --from=build-stage --chown=node:node /opt/app/dist ./dist
|
||||
COPY --from=build-stage --chown=node:node /opt/app/build ./build
|
||||
COPY --from=build-stage --chown=node:node /opt/app/package.json ./
|
||||
COPY --from=build-stage --chown=node:node /opt/app/public ./public
|
||||
# ASTUCE : On copie tout l'objet de build avec --chown
|
||||
# Cela évite de lister les dossiers un par un et de risquer un "Not Found"
|
||||
COPY --from=build-stage --chown=node:node /opt/app ./
|
||||
|
||||
# On expose le binaire
|
||||
ENV PATH=/opt/app/node_modules/.bin:$PATH
|
||||
|
||||
Reference in New Issue
Block a user