-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (25 loc) · 863 Bytes
/
Dockerfile
File metadata and controls
36 lines (25 loc) · 863 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
# Stage 1: Build
FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json ./
COPY apps/api/package*.json apps/api/
COPY apps/web/package*.json apps/web/
RUN npm ci --workspaces --include-workspace-root
COPY . .
RUN npm run build \
&& npx prisma generate --schema=apps/api/prisma/schema.prisma
# Stage 2: Runtime
FROM node:22-alpine
WORKDIR /app
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/apps/api/dist ./apps/api/dist
COPY --from=builder /app/apps/api/prisma ./apps/api/prisma
COPY --from=builder /app/apps/web/dist ./apps/web/dist
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/apps/api/package*.json ./apps/api/
COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENV NODE_ENV=production
ENV DATABASE_URL=file:/data/app.db
VOLUME ["/data"]
ENTRYPOINT ["/docker-entrypoint.sh"]