From d634573dd67b3f05d94e5e81c44020e06d1392d8 Mon Sep 17 00:00:00 2001 From: Marvin Date: Thu, 24 Sep 2026 19:03:26 +0200 Subject: [PATCH] Add .dockerignore files for api and caddy Both use an allowlist so only the files each Dockerfile copies are sent to the build context. For caddy this keeps the TLS certificates and keys in data/ and config/ out of the context; for api it skips training code, datasets, saved models and caches. Co-Authored-By: Claude Sonnet 5 --- api/.dockerignore | 13 +++++++++++++ caddy/.dockerignore | 5 +++++ 2 files changed, 18 insertions(+) create mode 100644 api/.dockerignore create mode 100644 caddy/.dockerignore diff --git a/api/.dockerignore b/api/.dockerignore new file mode 100644 index 0000000..c0d77c9 --- /dev/null +++ b/api/.dockerignore @@ -0,0 +1,13 @@ +# Allowlist: the Dockerfile only copies these three things, so nothing +# else (training code, datasets, saved models, caches) is sent to the daemon. +* +!requirements.txt +!src/production +!build_models + +# Re-exclude junk inside the allowed paths +**/__pycache__ +**/*.pyc +**/*.bat +**/.env +**/*.env diff --git a/caddy/.dockerignore b/caddy/.dockerignore new file mode 100644 index 0000000..b696118 --- /dev/null +++ b/caddy/.dockerignore @@ -0,0 +1,5 @@ +# Allowlist: only the Caddyfile is copied into the image. +# data/ and config/ hold TLS certificates and private keys at runtime +# (mounted as volumes) and must never end up in the build context. +* +!Caddyfile