Skip to content

🔒 Exclude .env from Docker context and git - #5

Merged
sl5-guy merged 1 commit into
mainfrom
fix/dockerignore-env
Jul 20, 2026
Merged

🔒 Exclude .env from Docker context and git#5
sl5-guy merged 1 commit into
mainfrom
fix/dockerignore-env

Conversation

@luiscosio

Copy link
Copy Markdown
Contributor

Two-line defense-in-depth fix, independent of #4.

Dockerfile runs COPY . . and Docker does not read .gitignore. This repo currently has no .env usage (config arrives via runtime env vars), so nothing has leaked — but nothing stopped a .env created for local convenience from being committed (.gitignore didn't cover it either) or baked into an image layer permanently.

Adds .env / .env.* to both .dockerignore and .gitignore.

Dockerfile runs COPY . . and Docker does not read .gitignore. This
repo takes config via runtime env vars and has no .env today, but
nothing prevented one from being created (e.g. for local compose use),
committed, or baked into an image layer. Cheap insurance on both
fronts.
@sl5-guy
sl5-guy merged commit f94c892 into main Jul 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants