-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.rotation-release-id-backfill
More file actions
47 lines (36 loc) · 1.93 KB
/
Copy pathDockerfile.rotation-release-id-backfill
File metadata and controls
47 lines (36 loc) · 1.93 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
#Build stage
FROM node:24-alpine AS builder
ARG NPM_TOKEN
WORKDIR /rotation-release-id-backfill-builder
COPY ./.npmrc ./
COPY ./package.json ./package-lock.json ./
COPY ./tsconfig.base.json ./
COPY ./shared/database ./shared/database
COPY ./shared/lml-client ./shared/lml-client
COPY ./jobs/rotation-release-id-backfill ./jobs/rotation-release-id-backfill
RUN npm ci && npm run build --workspace=@wxyc/database --workspace=@wxyc/lml-client --workspace=@wxyc/rotation-release-id-backfill
#Production stage
FROM node:24-alpine AS prod
ARG NPM_TOKEN
WORKDIR /rotation-release-id-backfill
COPY ./.npmrc ./
COPY ./package* ./
COPY ./jobs/rotation-release-id-backfill/package* ./jobs/rotation-release-id-backfill/
COPY ./shared/database/package* ./shared/database/
COPY ./shared/lml-client/package* ./shared/lml-client/
# `@wxyc/lml-client` declares `@wxyc/shared` as a registry dependency
# (GitHub Packages, `@wxyc:registry` in `.npmrc`). Without NPM_TOKEN +
# .npmrc the prod stage's npm install 401s on @wxyc/shared. Mirrors the
# pattern in Dockerfile.backend and the BS#1015 lesson.
RUN npm install --omit=dev && rm -f .npmrc
COPY --from=builder ./rotation-release-id-backfill-builder/jobs/rotation-release-id-backfill/dist ./jobs/rotation-release-id-backfill/dist
COPY --from=builder ./rotation-release-id-backfill-builder/shared/database/dist ./shared/database/dist
COPY --from=builder ./rotation-release-id-backfill-builder/shared/lml-client/dist ./shared/lml-client/dist
# Per-statement timeout: the writer does single-row UPDATEs; 60 s is more
# than enough headroom. The 300 s timeout the metadata backfill uses is
# for batches that regenerate flowsheet's search_doc tsvector (6 indexes
# per row); not applicable here.
ENV DB_STATEMENT_TIMEOUT_MS=60000
# Identifies the connection in pg_stat_activity during incident triage.
ENV DB_APPLICATION_NAME=wxyc-rotation-release-id-backfill
CMD ["npm", "start", "--workspace=@wxyc/rotation-release-id-backfill"]