-
Notifications
You must be signed in to change notification settings - Fork 1
/
Backend.Dockerfile
41 lines (32 loc) · 1.24 KB
/
Backend.Dockerfile
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
FROM node:22 AS builder
RUN corepack enable && corepack prepare [email protected] --activate && pnpm store path
WORKDIR /filing-deadlines
COPY pnpm-*.yaml ./
RUN pnpm fetch
COPY .dockerignore .dockerignore
COPY backend-shared backend-shared
COPY fs-shared fs-shared
COPY server server
COPY worker worker
COPY repl repl
RUN pnpm install --offline --frozen-lockfile --reporter=append-only
WORKDIR /filing-deadlines/worker
RUN pnpm run build
WORKDIR /filing-deadlines/repl
RUN pnpm run build
WORKDIR /filing-deadlines/server
RUN pnpm run build
FROM node:22-alpine
RUN corepack enable && corepack prepare [email protected] --activate && pnpm store path
WORKDIR /filing-deadlines
COPY pnpm-*.yaml ./
RUN pnpm fetch --prod
# only needs to copy the javascript files, but because there is no build dir, it copies everything.
COPY --from=builder /filing-deadlines/backend-shared backend-shared
COPY --from=builder /filing-deadlines/fs-shared fs-shared
COPY --from=builder /filing-deadlines/server server
COPY --from=builder /filing-deadlines/worker worker
COPY --from=builder /filing-deadlines/repl repl
RUN pnpm install --offline --frozen-lockfile --reporter=append-only --prod
# by default, it starts up a fastify server, but really this should be overriden
CMD ["node", "index.js"]