Skip to content
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

Dockerfile update #8

Merged
merged 2 commits into from
Dec 2, 2024
Merged

Dockerfile update #8

merged 2 commits into from
Dec 2, 2024

Conversation

CrzyHAX91
Copy link
Owner

@CrzyHAX91 CrzyHAX91 commented Dec 2, 2024

Summary by Sourcery

Update the Dockerfile to optimize the build process and enhance security by using a slimmer base image, installing necessary system dependencies, and running the application as a non-root user.

Build:

  • Update the Dockerfile to use a slimmer base image for reduced image size.
  • Add installation of system dependencies for building Python packages.
  • Implement multi-stage build to improve caching by copying requirements separately before other files.
  • Switch to a non-root user for running the application to enhance security.

Copy link

sourcery-ai bot commented Dec 2, 2024

Reviewer's Guide by Sourcery

This PR updates the Dockerfile to implement several Docker best practices, including using a slim base image, multi-stage builds, improved layer caching, and security enhancements. The changes optimize the container build process and improve the security posture of the application.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Switch to a lighter base image and optimize environment variables
  • Changed base image from python:3.9 to python:3.9-slim
  • Consolidated environment variables into a single layer
  • Added APP_HOME environment variable for consistency
Dockerfile
Improve build efficiency and layer caching
  • Separated requirements installation from application code copying
  • Added specific system dependencies installation with cleanup
  • Optimized apt-get commands to reduce layer size
Dockerfile
Implement security best practices
  • Created and switched to non-root user 'appuser'
  • Set appropriate ownership permissions for application files
  • Removed setup.py execution from build process
Dockerfile

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We have skipped reviewing this pull request. We don't review packaging changes - Let us know if you'd like us to change this.

@CrzyHAX91 CrzyHAX91 merged commit a73057b into main Dec 2, 2024
5 of 7 checks passed
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.

1 participant