feat: enhance Dockerfile security and add .dockerignore (#843)#844
Open
Aryanbansal-05 wants to merge 1 commit into
Open
feat: enhance Dockerfile security and add .dockerignore (#843)#844Aryanbansal-05 wants to merge 1 commit into
Aryanbansal-05 wants to merge 1 commit into
Conversation
…a#843) - Add PYTHONDONTWRITEBYTECODE and PYTHONUNBUFFERED env vars - Create non-root appuser for least-privilege execution - Add .dockerignore to exclude venv, cache, git, IDE files
|
@Aryanbansal-05 is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
The CI test failures are pre-existing issues caused by a broken import in test_basic.py (WEIGHT_LEVEL not found in utils.recommender). These are unrelated to this PR and are already fixed in PR #834. This PR only modifies Dockerfile and .dockerignore with no impact on application code or tests. |
Open
2 tasks
Contributor
Author
|
Hi @komalharshita, |
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.
Summary [required]
This PR enhances the existing Dockerfile with security and optimization best practices, and adds a .dockerignore file to reduce the Docker build context. The container now runs as a non-root user, Python runtime is configured for cleaner container behavior, and unnecessary files like venv, pycache, and .git are excluded from builds. No application logic is affected.
Related Issue [required]
Closes #843
Type of Change [required]
What Was Changed [required]
| File | Change made |
Dockerfile | Added PYTHONDONTWRITEBYTECODE and PYTHONUNBUFFERED env vars; added non-root appuser for least-privilege execution
.dockerignore | Created new file to exclude git metadata, Python cache, venv, IDE files, and OS artifacts from build context
How to Test This PR [required]
git checkout your-branch-namepip install -r requirements.txtpython app.pypython tests/test_basic.pyExpected test output:
Test Results [required]
56 passed in 0.37s
Note: 16 pre-existing failures are unrelated to this PR (tracked in #834 ).
This PR only modifies Dockerfile and .dockerignore — no Python code changed.
Self-Review Checklist [required]
feat/,fix/,docs/,data/,style/,test/python tests/test_basic.pyand all 27 tests passflake8 .locally and there are no errorsprint()orconsole.log()debug statementsNotes for Reviewer
The 16 test failures visible in the test output are pre-existing issues unrelated to this PR and are being addressed separately in PR #834. This PR touches only Dockerfile and .dockerignore and has zero impact on application behavior.