-
Notifications
You must be signed in to change notification settings - Fork 1
infra(image): a .dockerignore that is read, 69 MB nobody reads, and bytecode in the layer #11211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5e8a6cd
infra(image): read the .dockerignore that is actually read, and drop …
MarkusNeusinger ef434ec
docs(changelog): PR reference
MarkusNeusinger 52c24a8
docs(image): scope the uv pin claim to the dependency chain
MarkusNeusinger 90e046a
ci(image): the change-detection comment no longer claims plots/ is in…
MarkusNeusinger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # What a `docker build -f api/Dockerfile .` is allowed to see. | ||
| # | ||
| # This file has to live at the REPO ROOT. Docker reads `.dockerignore` from the | ||
| # build CONTEXT, and the context of both the deploy step (api/cloudbuild.yaml) | ||
| # and the pre-merge job (.github/workflows/ci-image.yml) is `.` — so the | ||
| # `api/.dockerignore` that used to hold these rules was never read by anything. | ||
| # The proof was inside the file itself: it excluded `*.md`, and yet | ||
| # `COPY pyproject.toml uv.lock README.md ./` in the builder stage has succeeded | ||
| # on every build since it was written. | ||
| # | ||
| # Narrowing the context to `api/` instead is not an option: the image needs | ||
| # `core/`, `pyproject.toml` and `uv.lock`, which live above it. | ||
| # | ||
| # Allowlist, not denylist. A denylist that misses a new directory only makes the | ||
| # context quietly fatter — that is how ~230 MB (a 120 MB `.git` plus a 69 MB | ||
| # `plots/`) came to be uploaded on every build; an allowlist that misses one | ||
| # fails at the COPY line, which is the loud failure. `app/` keeps its own | ||
| # `app/.dockerignore`: the frontend build's context is `app`, so nothing here | ||
| # applies to it. | ||
| * | ||
|
|
||
| !api | ||
| !core | ||
| !pyproject.toml | ||
| !uv.lock | ||
| !README.md | ||
|
|
||
| # …and the noise that lives inside the trees above. `__pycache__` matters twice | ||
| # over now that the image compiles its own bytecode: a stale host `.pyc` copied | ||
| # into a layer would shadow the source it no longer matches. | ||
| **/__pycache__ | ||
| **/*.py[cod] | ||
| **/.pytest_cache | ||
| **/.ruff_cache | ||
| **/.mypy_cache | ||
|
|
||
| # `.env*` is already covered by the `*` above. It is spelled out anyway so that | ||
| # no future `!` line can let DATABASE_URL or ADMIN_TOKEN into a layer — the same | ||
| # rule the sibling repo kurrentschrift keeps in its own `.dockerignore`. | ||
| **/.env | ||
| **/.env.* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.