-
Notifications
You must be signed in to change notification settings - Fork 144
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (16 loc) · 756 Bytes
/
Copy pathDockerfile
File metadata and controls
23 lines (16 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# syntax=docker/dockerfile:1
FROM node:20-alpine
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
EXPOSE 8080
# Ephemeral CI token for scripts/fetch-repo-websites.mjs (prebuild); without
# it the shared runner IP usually hits GitHub's unauthenticated rate limit
# and the build falls back to the committed website snapshot. Mounted as a
# BuildKit secret rather than an ARG: build args are recorded in the pushed
# image's config (`docker history`), a secret mount never leaves this RUN.
# Absent secret (local builds) resolves to empty — same fallback as before.
RUN --mount=type=secret,id=github_token \
GITHUB_TOKEN="$(cat /run/secrets/github_token 2>/dev/null || true)" npm run build
CMD [ "npm", "run", "preview" ]