mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-11 22:34:04 +02:00
Add a .dockerignore (#1591)
tests/README.md has developers clone Home Assistant core into ./core, but Docker does not read .gitignore, so `COPY . /app/` shipped that ~300MB checkout into the build context and into the image on every build. It also changed what the build did. With /app/core already present as a real directory, `ln -s /core /app/core` linked *inside* it — leaving a stray /app/core/core -> /core — and scripts/setup-dependencies then installed from the copied host checkout rather than the image's own pinned clone. Excluding core/ (plus local virtualenvs, VCS state and caches) takes the build context from 412MB to 4.6MB and the image from 2.34GB to 2.1GB, and makes a build with a local ./core behave like a clean one: /app/core is the intended symlink to /core. This does remove an accident. An image built while a local ./core existed happened to run without `-v $(pwd):/app`, because the copied checkout carried relative symlinks that still resolved inside /app. A clean-checkout build never had that property — there the symlinks setup-symlinks writes into /core dangle — and tests/README.md requires the mount either way. 479 passed, unchanged. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
3e78ac7e21
commit
da749bcf61
1 changed files with 28 additions and 0 deletions
28
.dockerignore
Normal file
28
.dockerignore
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# The Home Assistant core checkout. tests/README.md has you clone it to ./core,
|
||||
# but the Dockerfile clones its own copy to /core and links /app/core to it.
|
||||
# Without this entry `COPY . /app/` ships ~300MB into every build and leaves
|
||||
# /app/core as a real directory, so `ln -s /core /app/core` links *inside* it
|
||||
# rather than creating the intended symlink.
|
||||
core/
|
||||
|
||||
# Local virtualenvs
|
||||
.venv/
|
||||
venv/
|
||||
env/
|
||||
ENV/
|
||||
|
||||
# Not used by the build
|
||||
.git/
|
||||
.vscode/
|
||||
.idea/
|
||||
|
||||
# Caches and test output
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
.pytest_cache/
|
||||
.ruff_cache/
|
||||
.mypy_cache/
|
||||
htmlcov/
|
||||
.coverage
|
||||
.coverage.*
|
||||
coverage.xml
|
||||
Loading…
Add table
Add a link
Reference in a new issue