Files
kschianoandClaude Opus 5.5 b9d692a91c
CI / test (pull_request) Successful in 41s
Build the site image on Red Hat's hardened images
Node build on hi/nodejs:22-builder, the nginx config checked with `nginx -t` on
hi/nginx:latest-builder, served by the distroless hi/nginx runtime (UID 65532,
no shell). nginx keeps temp files in /tmp so the pod can run with a read-only
root filesystem; adds nosniff/referrer headers and hides the nginx version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 20:49:45 -05:00

25 lines
1.1 KiB
Docker

# The published Atlas page as a container, on Red Hat's hardened images: build the static site with Node, check
# the nginx config with the nginx builder (it has a shell), then serve with the distroless nginx runtime (no shell
# or package manager, UID 65532, port 8080). .gitea/workflows/image.yml builds this on every push to main and
# pushes it to harbor.kenschiano.net/home/threshing-atlas:latest; Argo CD Image Updater rolls the deployment
# (kubefiles, web/threshing-atlas) when that digest changes.
ARG NODE_TAG=22
ARG NGINX_TAG=latest
FROM registry.access.redhat.com/hi/nodejs:${NODE_TAG}-builder AS build
# Only /site leaves this stage, so build as root
USER root
WORKDIR /src
COPY . .
RUN node site/build.js /site
# Fail the build on a bad config, since the runtime image can't run `nginx -t` for us
FROM registry.access.redhat.com/hi/nginx:${NGINX_TAG}-builder AS nginx-check
COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf
RUN nginx -t -e /dev/stderr
FROM registry.access.redhat.com/hi/nginx:${NGINX_TAG}
COPY --from=nginx-check /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
COPY --from=build /site /usr/share/nginx/html
EXPOSE 8080