-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (22 loc) · 788 Bytes
/
Dockerfile
File metadata and controls
36 lines (22 loc) · 788 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
FROM node:21-alpine3.18 AS builder
WORKDIR /app
COPY ./package*.json .
RUN yarn install --frozen-lockfile
COPY . .
ENV NODE_ENV=production \
NEXT_PUBLIC_API_URL=https://crm-api.fly.dev
ENV NEXTAUTH_SECRET=D2cHrJszmk54PigHGOUn1TSOlcfXSxVny0JUFN0IVzE=
RUN yarn build
# Remove dev dependencies
RUN npm prune --production
FROM node:21-alpine3.18
WORKDIR /app
ENV NODE_ENV=production \
NEXT_PUBLIC_API_URL=https://crm-api.fly.dev
ENV NEXTAUTH_SECRET=D2cHrJszmk54PigHGOUn1TSOlcfXSxVny0JUFN0IVzE=
# COPY --from=builder /app/package.json ./package.json
# COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/static ./.next/static
CMD ["node", "server.js"]