
solve this ticket : https://app.ora.pm/p/fb56ed95daa7456b888d266a050b9afa?v=86662&s=28293&t=k&c=657791f3b1c64e6cbbf22f9378c0bdae Co-authored-by: OxSaitama <arnaud.daubernatali@smart-chain.fr>
36 lines
985 B
Docker
36 lines
985 B
Docker
# Install dependencies only when needed
|
|
FROM node:19-alpine AS deps
|
|
|
|
WORKDIR LEcoffre
|
|
|
|
COPY package.json ./
|
|
|
|
RUN npm install --frozen-lockfile
|
|
|
|
# Rebuild the source code only when needed
|
|
FROM node:19-alpine AS builder
|
|
|
|
WORKDIR LEcoffre
|
|
|
|
COPY . .
|
|
COPY --from=deps LEcoffre/node_modules ./node_modules
|
|
RUN npm run build
|
|
|
|
# Production image, copy all the files and run next
|
|
FROM node:19-alpine AS production
|
|
|
|
WORKDIR LEcoffre
|
|
|
|
RUN adduser -D lecoffreuser --uid 10000 && chown -R lecoffreuser .
|
|
|
|
COPY --from=builder --chown=lecoffreuser LEcoffre/node_modules ./node_modules
|
|
COPY --from=builder --chown=lecoffreuser LEcoffre/public ./public
|
|
COPY --from=builder --chown=lecoffreuser LEcoffre/dist/front ./src/front
|
|
COPY --from=builder --chown=lecoffreuser LEcoffre/.next ./.next
|
|
|
|
COPY --from=builder --chown=lecoffreuser LEcoffre/package.json ./package.json
|
|
#COPY --from=builder --chown=lecoffreuser src/front/next.config.js ./next.config.js
|
|
|
|
USER lecoffreuser
|
|
|
|
CMD ["npm", "run web:start"] |