Files
story/deploy/web.Dockerfile
T
Codex Local 0c2151ace9
ci / verify (push) Canceled after 0s
chore: checkpoint 第一版
2026-09-06 17:04:11 +08:00

28 lines
1.0 KiB
Docker

FROM node:24-alpine AS build
ARG NPM_CONFIG_REGISTRY=https://registry.npmjs.org
WORKDIR /src
COPY web/package*.json ./
RUN npm ci
COPY openapi /openapi
COPY web ./
RUN npm run generate:api && npm run build
FROM nginxinc/nginx-unprivileged:1.30.4-alpine
ARG VERSION=dev
ARG COMMIT=unknown
ARG BUILD_TIME=unknown
LABEL org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.revision="${COMMIT}" \
org.opencontainers.image.created="${BUILD_TIME}"
USER root
RUN apk upgrade --no-cache
# The image's IPv6 helper shells out to `apk manifest nginx` on every start.
# On small production hosts that command can block even after the package
# database is healthy. This deployment owns default.conf and does not need it.
RUN rm -f /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
COPY --chown=101:101 deploy/web.nginx.conf /etc/nginx/conf.d/default.conf
COPY --chmod=755 --chown=101:101 deploy/web-runtime-config.sh /docker-entrypoint.d/40-runtime-config.sh
COPY --chown=101:101 --from=build /src/dist /usr/share/nginx/html
USER 101
EXPOSE 8080