mirror of
https://github.com/QingWei-Li/notea.git
synced 2024-12-01 19:34:54 +03:00
29 lines
582 B
Docker
29 lines
582 B
Docker
# Stage 1: Building the code
|
|
FROM node:alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json yarn.lock ./
|
|
|
|
RUN yarn install --frozen-lockfile
|
|
|
|
COPY . .
|
|
|
|
RUN yarn build
|
|
RUN yarn install --production --frozen-lockfile
|
|
|
|
|
|
# Stage 2: And then copy over node_modules, etc from that stage to the smaller base image
|
|
FROM node:alpine as production
|
|
|
|
WORKDIR /app
|
|
|
|
# COPY package.json next.config.js .env* ./
|
|
COPY --from=builder /app/public ./public
|
|
COPY --from=builder /app/.next ./.next
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
|
|
EXPOSE 3000
|
|
|
|
CMD ["node_modules/.bin/next", "start"]
|