Files
story/deploy/web.Dockerfile
T

28 lines
1.0 KiB
Docker
Raw Permalink Normal View History

2026-08-26 06:41:07 +08:00
FROM node:24-alpine AS build
2026-09-06 17:04:11 +08:00
ARG NPM_CONFIG_REGISTRY=https://registry.npmjs.org
2026-08-26 06:41:07 +08:00
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
2026-08-26 06:57:12 +08:00
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}"
2026-08-26 06:41:07 +08:00
USER root
RUN apk upgrade --no-cache
2026-09-06 17:04:11 +08:00
# 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
2026-08-26 06:41:07 +08:00
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