-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (33 loc) · 1.06 KB
/
Dockerfile
File metadata and controls
42 lines (33 loc) · 1.06 KB
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
42
FROM node:22-bullseye AS deps
# RUN apt-get update && apt-get install
WORKDIR /app
COPY package.json ./
COPY prisma/ ./prisma/
RUN npm install
FROM node:22-bullseye AS builder
WORKDIR /app
# Temporary environment variable for prisma generate
ENV PRISMA_DB_URL="file:./dev.db"
COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/package.json ./package.json
COPY --from=deps /app/prisma/ ./prisma/
COPY prisma.config.ts ./prisma.config.ts
COPY tsconfig.json ./tsconfig.json
COPY src/ ./src/
COPY templates/ ./templates/
COPY static/ ./static
RUN npm install -g typescript
RUN npx prisma generate
RUN tsc
FROM node:22-bullseye AS runner
WORKDIR /app
ENV NODE_ENV=production
COPY --from=builder /app/build ./build
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/prisma/ ./prisma/
COPY --from=builder /app/prisma.config.ts ./prisma.config.ts
COPY --from=builder /app/templates/ ./templates/
COPY --from=builder /app/static/ ./static/
EXPOSE 4000
CMD ["npm", "run", "start"]