-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
41 lines (37 loc) · 968 Bytes
/
Dockerfile
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
38
39
40
41
# Build Stage
FROM node:21-alpine AS builder
ENV NODE_ENV production
# Be sure to keep these up to date from time to time. RC.
ARG AUTHORIZED_EMAILS
ARG DATA_DIR
ARG EMAIL_FROM
ARG EMAIL_SERVER_HOST
ARG EMAIL_SERVER_PASSWORD
ARG EMAIL_SERVER_PORT
ARG EMAIL_SERVER_USER
ARG GCP_JSON_CREDS
ARG GCS_BUCKET_NAME
ARG NEXTAUTH_URL
ARG OPENAI_API_KEY
ARG PORT
ARG POSTGRES_URI
ARG PROMETHEUS_SECRET
WORKDIR /app
COPY . .
RUN npm install && \
npx prisma generate && \
npm run build && \
rm -rf node_modules/.cache
# Production Stage
FROM node:21-alpine
WORKDIR /app
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/next.config.js ./next.config.js
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/package.json ./package.json
# Set Environment Variable for Production
EXPOSE 3000
# Command to start the application
CMD ["npm", "start"]