Skip to content

chore: keep secrets out of the Docker build context; drop stale README step - #153

Merged
BaaRai merged 1 commit into
mainfrom
chore/dockerignore-and-readme
Nov 6, 2026
Merged

BaaRai merged 1 commit into
mainfrom
chore/dockerignore-and-readme

Conversation

@BaaRai

@BaaRai BaaRai commented Nov 6, 2026

Copy link
Copy Markdown
Owner

What changed

  • .dockerignore: exclude .env, config.json, jwt.key and backups from the build context. keys was already listed, so it is not duplicated. Entries follow the file's existing style (root-relative names, no trailing slash).
  • README.md, "Option 2: Docker Compose (manual)": remove the line that told users to build the single binary (frontend, then go build -tags embedui) before docker compose up -d --build.

Why

Since #147 the Dockerfile is a multi-stage build: a Node stage builds the frontend, a Go stage builds the binary through build.sh, and the runtime stage copies the result. Its build stage runs COPY . ., so every file in the checkout root that is not ignored goes to the builder. install.sh writes .env (Postgres password, API key) and, for the local option, config.json; the local binary writes jwt.key; scripts/backup.sh writes database dumps to backups/ by default. None of these are needed to build the image, and none should end up in the build context or a build cache.

The README step was left over from before #147: docker compose up -d --build now builds the frontend and the binary itself (compose builds artex from context: .), so the manual pre-build is unnecessary and misleading. The surrounding instructions already describe the Docker path and are unchanged.

How it was checked

  • Read the Dockerfile and docker-compose.yml on main: no stage copies or needs .env, config.json, jwt.key or backups/; .env is consumed by compose for variable substitution, not by the image build, and .env.example is not affected by the .env pattern.
  • git ls-files shows none of the newly ignored paths are tracked.
  • docker build . on this branch (from WSL) completed successfully. The live stack was not started.

…E step

The build stage of the Dockerfile runs `COPY . .`, so anything left in the
checkout root is sent to the builder and copied into the build stage. Exclude
the local secrets and backups that the install and backup scripts create
there: .env, config.json, jwt.key and backups/. keys/ was already excluded.

The Docker Compose (manual) section of the README still told users to build
the single binary before `docker compose up -d --build`. Since the
multi-stage Dockerfile builds the frontend and the Go binary itself, that
step is no longer needed; remove it.
@BaaRai
BaaRai merged commit a908e1e into main Nov 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant