-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.api
More file actions
38 lines (29 loc) · 1.07 KB
/
Copy pathDockerfile.api
File metadata and controls
38 lines (29 loc) · 1.07 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
# syntax=docker/dockerfile:1
FROM node:22-bookworm-slim AS base
RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN corepack enable
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY apps/api/package.json apps/api/
COPY apps/client/package.json apps/client/
COPY apps/api-e2e/package.json apps/api-e2e/
RUN pnpm install --frozen-lockfile
FROM base AS build
COPY nx.json tsconfig.base.json tsconfig.json ./
COPY apps/api apps/api
COPY apps/client/tsconfig.json apps/client/
COPY apps/api-e2e/tsconfig.json apps/api-e2e/
RUN pnpm exec nx run @deploy-flow/api:build
FROM node:22-bookworm-slim AS prod
RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*
WORKDIR /app
ENV NODE_ENV=production
RUN corepack enable
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY apps/api/package.json apps/api/
COPY apps/client/package.json apps/client/
COPY apps/api-e2e/package.json apps/api-e2e/
RUN pnpm install --prod --frozen-lockfile
COPY --from=build /app/apps/api/dist ./dist
EXPOSE 3000
CMD ["node", "dist/main.js"]