From 625b142ed44d5c53214b7263e8811a0d2142d581 Mon Sep 17 00:00:00 2001 From: jakeross Date: Tue, 18 Aug 2026 16:30:30 -0700 Subject: [PATCH] chore(ci): keep .git out of the Dagster+ build context Every deploy was transferring 316 MB before the first layer could build. The tracked tree is 13 MB; the rest was almost entirely .git, which CI clones with full history and which nothing in the image reads. The context is now 6.7 MB. Also excluded: Python caches, which are worse than useless in an image built on a pinned base; test fixtures and BDD features, since the image runs the code location and CI runs the suite outside it; and transfers/data, logs, and metrics, which are untracked, machine-specific, and roughly 900 MB on a developer checkout -- a local `docker build` was shipping all of it. Verified by building the real image with the new context: db, domain, services, core, schemas, automated_ingestion, and alembic are all present, db and domain import, and the code location resolves all four assets. Co-Authored-By: Claude Opus 5 --- .dockerignore | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index b694934fb..95b01de27 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,45 @@ -.venv \ No newline at end of file +# Keep the build context to what the image actually runs. +# +# The tracked tree is ~13 MB; the context was ~316 MB, almost entirely .git. +# CI clones full history, and every Dagster+ deploy was transferring it before +# the first layer could build. + +# Version control. Nothing in the image reads git metadata. +.git +.github +.gitignore + +# Python build and cache artifacts. Stale .pyc from a different interpreter is +# worse than useless in an image built on a pinned base. +__pycache__/ +*.py[cod] +*.egg-info/ +.pytest_cache/ +.ruff_cache/ +.mypy_cache/ +.coverage +htmlcov/ + +# Virtualenvs and local tooling state. +.venv +.dg +*.tfstate +*.tfstate.* +.terraform/ + +# Local-only data from legacy transfer runs. Untracked, machine-specific, and +# the largest thing on a developer checkout by an order of magnitude -- a local +# `docker build` would otherwise ship ~900 MB of CSV cache. +transfers/data/ +transfers/logs/ +transfers/metrics/ + +# Test fixtures and BDD features. The image runs the code location, not the +# suite; CI runs the suite outside the image. +tests/ +features/ + +# Editor and OS noise. +.DS_Store +.idea/ +.vscode/