mirror of
https://github.com/theoludwig/theoludwig.git
synced 2025-05-29 22:37:44 +02:00
chore: add devcontainer
This commit is contained in:
28
Dockerfile
28
Dockerfile
@ -1,11 +1,23 @@
|
||||
FROM node:16.3.0
|
||||
|
||||
FROM node:16.3.0 AS dependencies
|
||||
WORKDIR /usr/src/app
|
||||
RUN chown --recursive node:node /usr/src/app
|
||||
COPY --chown=node:node ./package*.json ./
|
||||
RUN npm install
|
||||
COPY --chown=node:node ./ ./
|
||||
COPY ./package*.json ./
|
||||
RUN npm clean-install
|
||||
|
||||
USER node
|
||||
FROM node:16.3.0 AS builder
|
||||
WORKDIR /usr/src/app
|
||||
COPY ./ ./
|
||||
COPY --from=dependencies /usr/src/app/node_modules ./node_modules
|
||||
RUN npm run build
|
||||
CMD ["npm", "run", "start", "--", "--port", "${PORT}"]
|
||||
|
||||
FROM node:16.3.0 AS runner
|
||||
WORKDIR /usr/src/app
|
||||
ENV NODE_ENV=production
|
||||
COPY --from=builder /usr/src/app/next.config.js ./next.config.js
|
||||
COPY --from=builder /usr/src/app/public ./public
|
||||
COPY --from=builder /usr/src/app/.next ./.next
|
||||
COPY --from=builder /usr/src/app/i18n.json ./i18n.json
|
||||
COPY --from=builder /usr/src/app/locales ./locales
|
||||
COPY --from=builder /usr/src/app/pages ./pages
|
||||
COPY --from=builder /usr/src/app/node_modules ./node_modules
|
||||
RUN npx next telemetry disable
|
||||
CMD ["node_modules/.bin/next", "start", "--port", "${PORT}"]
|
||||
|
Reference in New Issue
Block a user