chore(docker): trim build context with .dockerignore #3
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
tweek/cairn!3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "BOAScripts/cairn:chore/dockerfile-hardening"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The build context previously carried the whole repo, including .git
(2.6 MB) and docs/ (2.2 MB of screenshots), plus any local .env.
Deny everything in .dockerignore and re-include only the build's real
inputs: go.mod, go.sum, cmd/, internal/ and web/ (the latter two cover
the go:embed trees for migrations, templates and static assets).
The Dockerfile now COPYs those paths explicitly instead of
COPY . ..Without .git in the context the
git describefallback can no longerwork, so it is dropped in favour of ARG VERSION=dev; the release
workflow already injects the tag, and README documents the
--build-arg VERSION=... form for stamped local builds.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
Thanks for the contribution. This PR has been integrated manually into main as commit
8e03a7e. The branch was based just before the repository migration from GitHub to Forgejo, which caused a documentation conflict in README.md. I resolved it by preserving the current Forgejo workflow and deployment references while adding the new .dockerignore documentation. The Docker changes themselves were applied unchanged, and the full Go test suite passes on the merged tree. Closing this PR as integrated.Pull request closed