-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (39 loc) · 1.2 KB
/
Dockerfile
File metadata and controls
54 lines (39 loc) · 1.2 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
43
44
45
46
47
48
49
50
51
52
53
54
FROM node:22-alpine AS builder
WORKDIR /app
RUN apk add --no-cache --virtual .build-deps build-base python3
COPY package.json yarn.lock ./
COPY api/package.json ./api/
COPY api/prisma/ ./api/prisma/
RUN yarn install --frozen-lockfile
COPY tsconfig.base.json ./
COPY tsconfig.json ./
COPY api/tsconfig.json ./api/
COPY api/src/ ./api/src/
COPY config.ts ./
COPY api/types/ ./api/types/
WORKDIR /app/api
RUN yarn db:generate && \
yarn orderly:generate && \
yarn nexus:generate && \
yarn sv:generate && \
yarn build && \
apk del .build-deps
FROM node:22-alpine AS runtime
WORKDIR /app/api
ENV NODE_ENV=production
ENV PORT=3001
ENV MIGRATE_DB=false
COPY --from=builder /app/api/package.json ./
COPY --from=builder /app/api/dist ./dist
COPY --from=builder /app/api/prisma ./prisma
COPY --from=builder /app/node_modules /app/node_modules
COPY --from=builder /app/api/node_modules ./node_modules
COPY --from=builder /app/api/src/workflows /app/workflows
COPY --from=builder /app/api/src/lib/generated ./src/lib/generated
RUN addgroup -S appgroup && \
adduser -S appuser -G appgroup && \
chown -R appuser:appgroup /app
USER appuser
EXPOSE 3001
ENV IS_DOCKER=true
CMD ["node", "dist/index.cjs"]