22 lines
1.2 KiB
Docker
22 lines
1.2 KiB
Docker
# Full frontend source build. Compatible with the test server's Docker 18.06.
|
|
FROM docker.m.daocloud.io/node:22-slim AS builder
|
|
ARG PNPM_VERSION=10.15.1
|
|
WORKDIR /src
|
|
RUN npm install --global pnpm@${PNPM_VERSION}
|
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
|
RUN pnpm install --frozen-lockfile
|
|
COPY . .
|
|
RUN pnpm build
|
|
ARG VERSION=local
|
|
ARG SOURCE_REVISION=unknown
|
|
ARG SOURCE_TREE=unknown
|
|
RUN node --input-type=module -e 'import fs from "node:fs"; const info = { formatVersion: 1, version: process.env.VERSION, revision: process.env.SOURCE_REVISION, tree: process.env.SOURCE_TREE, builtAt: new Date().toISOString() }; fs.writeFileSync("dist/build-info.json", JSON.stringify(info)); fs.writeFileSync("dist/version.txt", info.version + "\n");'
|
|
|
|
FROM docker.m.daocloud.io/nginx:1.28-alpine@sha256:a8b39bd9cf0f83869a2162827a0caf6137ddf759d50a171451b335cecc87d236
|
|
ARG VERSION=local
|
|
LABEL org.opencontainers.image.revision=$VERSION
|
|
COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf
|
|
COPY --from=builder /src/dist/ /usr/share/nginx/html/
|
|
HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD wget -q -O /dev/null http://127.0.0.1/healthz || exit 1
|