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

optimize Dockerfile #108

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

optimize Dockerfile #108

wants to merge 4 commits into from

Conversation

kovaacs
Copy link

@kovaacs kovaacs commented Jan 23, 2025

The current Dockerfile isn't set up optimally, so any code change results in the whole image to be rebuilt from scratch.

  • Reduce Layers: Combined apt-get update, install, and cleanup into a single RUN command to minimize image layers.
  • Leverage Docker Cache: Copied requirements.txt first to ensure Python dependencies are installed only when requirements.txt changes. This improves build times for subsequent builds when application code is updated but dependencies remain the same.
  • Smaller Image Size: Used --no-install-recommends to install only necessary packages and cleaned up package cache (apt-get clean and rm -rf /var/lib/apt/lists/*).

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