From 6c9e9b381da558949628fefc721f696594964010 Mon Sep 17 00:00:00 2001 From: agalend <151345981+agalend@users.noreply.github.com> Date: Sun, 1 Nov 2026 17:41:56 +0200 Subject: [PATCH] Remove comments from the build files Keep only the comments that explain a non-obvious reason. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/ci.yml | 5 ----- Dockerfile | 9 +-------- docker/nginx.conf | 5 +---- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c33d0d..5bf70ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,12 +6,9 @@ on: push: branches: [main] -# Least privilege by default; the image job adds what it needs. permissions: contents: read -# A newer push to the same pull request replaces the older run. Runs on main are -# never cancelled, so every merge produces its image. concurrency: group: ci-${{ github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} @@ -39,8 +36,6 @@ jobs: - run: npm run compile:tests - run: npx mocha 'dist-tests/tests/**/*.test.js' - # Pull requests build the image and check that it works, without publishing. - # A merge to main also publishes it for amd64 and arm64. image: needs: test runs-on: ubuntu-latest diff --git a/Dockerfile b/Dockerfile index bb64422..b035d7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,6 @@ # syntax=docker/dockerfile:1 -# The editor is a set of static files. The build stage always runs on the build -# machine's own architecture, so building images for several architectures does -# not run Node under emulation; only the final nginx layer is per architecture. +# Runs on the build machine's architecture so multi-architecture builds do not emulate Node. FROM --platform=$BUILDPLATFORM node:26-alpine AS build WORKDIR /app @@ -15,17 +13,12 @@ COPY assets ./assets COPY src ./src RUN npm run compile && npm run copy -# Development-only live reload must not ship. Fail the build if anything is left. RUN sed -i '/debug\/live-reload\.js/d' dist/index.html \ && rm -rf dist/debug \ && ! grep -rq "live-reload" dist -# The slim variant leaves out the optional modules (image filter, XSLT, GeoIP, -# njs) and the libraries they pull in. This site only needs core nginx and gzip, -# and every extra package is extra attack surface. FROM nginxinc/nginx-unprivileged:stable-alpine-slim COPY docker/nginx.conf /etc/nginx/conf.d/default.conf COPY --from=build /app/dist /usr/share/nginx/html -# Runs as a non-root user and listens on 8080. EXPOSE 8080 diff --git a/docker/nginx.conf b/docker/nginx.conf index 59c5d81..212b710 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -12,10 +12,7 @@ server { location / { try_files $uri $uri/ =404; - # File names are not content-hashed, so make browsers revalidate. nginx - # answers with 304 when nothing changed. add_header must be repeated - # here because a location that sets any header drops the ones from the - # server block. + # add_header is repeated here: a location that sets any header drops the server-level ones. add_header Cache-Control "no-cache" always; add_header X-Content-Type-Options "nosniff" always; add_header Referrer-Policy "strict-origin-when-cross-origin" always;