Add .dockerignore to prevent secrets leaking into Docker build context#2
Merged
boci11 merged 2 commits intoJul 2, 2026
Merged
Conversation
Adds .dockerignore to prevent .env, .git, node_modules, __pycache__, and other unnecessary files from being included in the Docker build context. This addresses the review comment (discussion_r3509898653) and improves security and build performance. Also includes the project scaffold files (docker-compose.yml, .devcontainer, .gitignore, .env.example, etc.) that were introduced in PR #1.
Copilot
AI
changed the title
[WIP] Fix code for review comment on pull request
Add .dockerignore to prevent secrets leaking into Docker build context
Jul 2, 2026
boci11
approved these changes
Jul 2, 2026
There was a problem hiding this comment.
Pull request overview
This PR adds Docker/Dev Container scaffolding for the “Codex” project and introduces a .dockerignore to prevent secrets (notably .env) and other noise from being sent in the Docker build context.
Changes:
- Added
.dockerignoreand.gitignorerules to keep.env/secrets and common artifacts out of build contexts and git. - Introduced Docker Compose + Dev Container configuration (Postgres service + app dev container setup).
- Replaced the root
README.mdwith project-specific setup instructions and added directory stubs via.gitkeep.
Reviewed changes
Copilot reviewed 6 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Replaces prior README with Codex-focused setup/docs (Dev Container + Compose + env vars). |
| docker-compose.yml | Adds app + Postgres services for local/devcontainer workflows. |
| .gitignore | Ignores .env and common OS/editor/dependency/artifact files. |
| .env.example | Adds example environment variables for OpenAI + Postgres. |
| .dockerignore | Excludes secrets and common noise from Docker build context. |
| .devcontainer/Dockerfile | Adds a simple devcontainer base image with postgresql-client. |
| .devcontainer/devcontainer.json | Configures VS Code Dev Containers to use the Compose app service. |
| src/.gitkeep | Adds stub directory for source. |
| docs/.gitkeep | Adds stub directory for documentation. |
| data/.gitkeep | Adds stub directory for data. |
| scripts/.gitkeep | Adds stub directory for scripts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+7
to
+9
| env_file: | ||
| - path: .env | ||
| required: false |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Without a
.dockerignore, the.envfile (containing secrets likePOSTGRES_PASSWORDandOPENAI_API_KEY) and other unnecessary files were being sent to the Docker daemon as part of the build context for theappservice.Changes
.dockerignore— excludes from build context:.env/.env.*(secrets).git(VCS metadata)node_modules/,__pycache__/,.venv/(dependency dirs)dist/,build/,*.log,.cache/(artifacts/noise).DS_Store,.vscode/,.idea/)Project scaffold — includes files from the prior bootstrap PR that weren't reflected on
main:docker-compose.yml,.devcontainer/,.gitignore,.env.example, and directory stubs (src/,docs/,data/,scripts/)