Skip to content

chore: add .dockerignore to optimize Docker build#174

Open
xu826Jamin wants to merge 1 commit intoc2siorg:mainfrom
xu826Jamin:chore/add-dockerignore
Open

chore: add .dockerignore to optimize Docker build#174
xu826Jamin wants to merge 1 commit intoc2siorg:mainfrom
xu826Jamin:chore/add-dockerignore

Conversation

@xu826Jamin
Copy link
Copy Markdown

This PR fixes #69

Description

  • Added a .dockerignore file to prevent unnecessary files from being
    copied into the Docker build context.
  • Excludes Python virtual environments (venv/, __pycache__, *.pyc)
  • Excludes Node dependencies (node_modules/)
  • Excludes Git metadata (.git/)
  • Excludes environment files (.env)
  • Excludes OS and IDE specific files (.DS_Store, .vscode/)

Additional context

  • Without this file, Docker copies the entire project including dependencies
    and cache files, making builds unnecessarily slow and images larger.
  • This is a zero-risk change that only affects Docker build performance.

Copilot AI review requested due to automatic review settings March 23, 2026 02:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new repo-root .dockerignore intended to reduce Docker build context size by excluding VCS metadata, dependency directories, caches, and local environment/editor files.

Changes:

  • Introduces a .dockerignore with ignore rules for Git, Python, Node, build outputs, env files, and IDE/OS artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +4
# Git
.git
.gitignore

Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the current docker-compose.yml, both services build from subdirectory contexts (./gdbui_server and ./webapp) and specify DockerFile.dev in those directories. Docker only applies .dockerignore from the build context root, so a repo-root .dockerignore will not affect these builds. To actually optimize builds, add .dockerignore files inside gdbui_server/ (backend) and/or update the compose build contexts to the repo root (and adjust dockerfile paths accordingly).

Copilot uses AI. Check for mistakes.
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.

Missing .dockerignore File to Optimize Docker Build

2 participants