-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (26 loc) · 786 Bytes
/
Dockerfile
File metadata and controls
29 lines (26 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM node:lts-alpine3.18 as dependencies
WORKDIR /app
COPY package.json package-lock.json ./
RUN apk add --no-cache --virtual .gyp \
python3 \
make \
g++ \
&& npm ci \
&& apk del .gyp
FROM node:lts-alpine3.18 as builder
WORKDIR /app
COPY . .
COPY --from=dependencies /app/node_modules ./node_modules
RUN npm run build
FROM node:lts-alpine3.18 as runner
ENV NODE_ENV=production
WORKDIR /app
# If you are using a custom next.config.js file, uncomment this line.
COPY --from=builder /app/.env.production ./
COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
EXPOSE 25000
CMD ["npm", "run", "start"]