Skip to content

Commit

Permalink
🐳 Refactor Dockerfile to adhere to best practices.
Browse files Browse the repository at this point in the history
  • Loading branch information
eli64s committed Jul 31, 2023
1 parent ce4263c commit 9e0262f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ All notable changes to this project will be documented in this file.
## [v0.0.5] - *2023-07-31*
### Security

- 🐳 Improve Dockerfile implementation to adhere to best practices.
- *Clean up installation:*: Clean up cache to reduce the image size after installing packages with apt-get.
- *Non-root user:* Add non-root user to ensure the user has limited permissions within the container.
- Specify a user ID and group ID that do not have superuser access.
- *File permissions:* Explicitly set file permissions to prevent potential vulnerabilities if the Docker image is run in a different context.
- 🐳 Refactor Dockerfile to adhere to best practices.
- *Package Installation and Cleanup:* Clean up cache after installing packages with apt-get to reduce the image size.
- *Non-root User Creation:* Introduce a non-root user within the container to limit permissions and enhance security.
- Assign a specific user ID and group ID that don't have superuser privileges.
- *File Permissions Management:* Explicitly manage file permissions to prevent potential security risks when the image operates in varied contexts.

---
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ RUN chown tempuser:tempuser /app
# Switch to the new user
USER tempuser

# Add the directory where pip installs user scripts to the PATH
ENV PATH=/home/tempuser/.local/bin:$PATH

# Install the readmeai package from PyPI with a pinned version
RUN pip install --no-cache-dir --user readmeai==0.1.0

Expand Down

0 comments on commit 9e0262f

Please sign in to comment.