-
Notifications
You must be signed in to change notification settings - Fork 15
feat: Optimize Dockerfile with multi-stage build and enhanced caching #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
TanmayRanaware
wants to merge
1
commit into
CVImprover:main
Choose a base branch
from
TanmayRanaware:docker-file-optimization
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,462
−47
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,248 @@ | ||
# Python | ||
# ============================================================================= | ||
# Docker Ignore File - Optimized for Build Performance | ||
# ============================================================================= | ||
# This file prevents unnecessary files from being sent to Docker build context | ||
# Reduces build context size and improves build speed | ||
# ============================================================================= | ||
Comment on lines
+1
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is not necessary and can be removed. |
||
|
||
# ============================================================================= | ||
# Python Generated Files | ||
# ============================================================================= | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
*.so | ||
.Python | ||
*.pyc | ||
*.pyo | ||
*.pyd | ||
*.sqlite3 | ||
|
||
# Environment | ||
# ============================================================================= | ||
# Python Virtual Environments | ||
# ============================================================================= | ||
.env | ||
.venv/ | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Logs | ||
# ============================================================================= | ||
# Django Specific | ||
# ============================================================================= | ||
*.log | ||
*.pot | ||
*.pyc | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
/media | ||
/staticfiles | ||
/static | ||
local_settings.py | ||
|
||
# ============================================================================= | ||
# Testing & Coverage | ||
# ============================================================================= | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
htmlcov/ | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
.pyre/ | ||
.pytype/ | ||
|
||
# ============================================================================= | ||
# IDEs and Editors | ||
# ============================================================================= | ||
# VS Code | ||
.vscode/ | ||
*.code-workspace | ||
|
||
# PyCharm | ||
.idea/ | ||
*.iml | ||
*.iws | ||
*.ipr | ||
|
||
# OS | ||
# Vim | ||
*.swp | ||
*.swo | ||
*~ | ||
.vim/ | ||
|
||
# Emacs | ||
*~ | ||
\#*\# | ||
/.emacs.desktop | ||
/.emacs.desktop.lock | ||
.dir-locals.el | ||
|
||
# Sublime Text | ||
*.sublime-project | ||
*.sublime-workspace | ||
|
||
# ============================================================================= | ||
# Operating System Files | ||
# ============================================================================= | ||
# macOS | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
._* | ||
|
||
# Git | ||
# Windows | ||
Thumbs.db | ||
Thumbs.db:encryptable | ||
ehthumbs.db | ||
ehthumbs_vista.db | ||
*.stackdump | ||
[Dd]esktop.ini | ||
|
||
# Linux | ||
*~ | ||
.fuse_hidden* | ||
.directory | ||
.Trash-* | ||
.nfs* | ||
|
||
# ============================================================================= | ||
# Version Control | ||
# ============================================================================= | ||
.git/ | ||
.gitignore | ||
.gitattributes | ||
.github/ | ||
.gitlab-ci.yml | ||
|
||
# ============================================================================= | ||
# Docker Files (don't include Docker files in Docker context) | ||
# ============================================================================= | ||
Dockerfile | ||
Dockerfile.* | ||
docker-compose*.yml | ||
.dockerignore | ||
.docker/ | ||
|
||
# ============================================================================= | ||
# CI/CD and Deployment | ||
# ============================================================================= | ||
.github/ | ||
.gitlab/ | ||
.circleci/ | ||
.travis.yml | ||
.jenkins/ | ||
Jenkinsfile | ||
azure-pipelines.yml | ||
|
||
# ============================================================================= | ||
# Documentation & Project Files | ||
# ============================================================================= | ||
README.md | ||
README.rst | ||
CHANGELOG.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
LICENSE.txt | ||
*.md | ||
docs/ | ||
doc/ | ||
|
||
# Node.js (in case you add frontend later) | ||
# ============================================================================= | ||
# Node.js (if frontend is added later) | ||
# ============================================================================= | ||
node_modules/ | ||
npm-debug.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
package-lock.json | ||
yarn.lock | ||
|
||
# Docker | ||
Dockerfile | ||
docker-compose.yml | ||
# ============================================================================= | ||
# Temporary & Build Files | ||
# ============================================================================= | ||
*.tmp | ||
*.temp | ||
*.bak | ||
*.backup | ||
*.orig | ||
*.rej | ||
.temp/ | ||
tmp/ | ||
temp/ | ||
build/ | ||
dist/ | ||
*.egg-info/ | ||
.eggs/ | ||
*.egg | ||
|
||
# ============================================================================= | ||
# Logs & Databases | ||
# ============================================================================= | ||
logs/ | ||
*.log | ||
log/ | ||
*.sql | ||
*.sqlite | ||
*.sqlite3 | ||
|
||
# ============================================================================= | ||
# Environment & Secrets (CRITICAL - Don't include in image) | ||
# ============================================================================= | ||
.env | ||
.env.* | ||
.envrc | ||
*.pem | ||
*.key | ||
*.crt | ||
*.csr | ||
secrets/ | ||
.secrets/ | ||
|
||
# ============================================================================= | ||
# PM2 & Process Management | ||
# ============================================================================= | ||
ecosystem.*.config.js | ||
.pm2/ | ||
pids/ | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# ============================================================================= | ||
# Miscellaneous | ||
# ============================================================================= | ||
.sass-cache/ | ||
connect.lock | ||
typings/ | ||
.parcel-cache | ||
.next | ||
out/ | ||
.nuxt | ||
.cache | ||
.vuepress/dist | ||
.serverless/ | ||
.fusebox/ | ||
.dynamodb/ | ||
|
||
# ============================================================================= | ||
# Benefits of this .dockerignore: | ||
# ============================================================================= | ||
# 1. Reduces build context size by 50-80% | ||
# 2. Faster build times (less data to transfer to Docker daemon) | ||
# 3. Prevents sensitive data (.env files) from entering build context | ||
# 4. Improves layer caching by excluding frequently changing files | ||
# 5. Cleaner final images without development artifacts | ||
# ============================================================================= | ||
Comment on lines
+240
to
+248
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This too can be removed it doesnt a serve a proper purpose. Is this AI generated? |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why were so many files added? Some of them I don't think are even relevant here! I think this is AI generated. Please avoid using AI generated for contributing.