-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (25 loc) · 750 Bytes
/
Dockerfile
File metadata and controls
37 lines (25 loc) · 750 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
30
31
32
33
34
35
36
37
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
ARG NEXT_MONGODB_URI
ARG NEXT_PUBLIC_BASE_URL
ARG NEXT_PUBLIC_ENCRYPTION_KEY
ARG NEXT_PUBLIC_ENCRYPTION_IV
ENV NEXT_MONGODB_URI=$NEXT_MONGODB_URI
ENV NEXT_PUBLIC_BASE_URL=$NEXT_PUBLIC_BASE_URL
ENV NEXT_PUBLIC_ENCRYPTION_KEY=$NEXT_PUBLIC_ENCRYPTION_KEY
ENV NEXT_PUBLIC_ENCRYPTION_IV=$NEXT_PUBLIC_ENCRYPTION_IV
RUN npm run build
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --omit=dev
COPY --from=builder /app/.next .next
COPY --from=builder /app/public public
COPY --from=builder /app/package.json .
COPY --from=builder /app/next.config.js .
COPY --from=builder /app/tsconfig.json .
EXPOSE 3000
ENTRYPOINT ["npm", "start"]