Optimize Docker Images#1722
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes Docker images for the Presidio components by modernizing build practices and reducing image size. The changes focus on improving build efficiency, reducing image layers, and using best practices for Docker builds.
- Remove the unused NAME build argument from all Dockerfiles and docker-compose files
- Add comprehensive .dockerignore files to exclude test files and development artifacts
- Consolidate apt install commands to reduce Docker layers and improve caching
- Update CMD syntax to use exec form for better signal handling
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| presidio-image-redactor/entrypoint.sh | New entrypoint script using exec form for proper signal handling |
| presidio-image-redactor/dockerignore | Comprehensive ignore file excluding tests, development files, and build artifacts |
| presidio-image-redactor/Dockerfile | Remove NAME arg, consolidate apt commands, use entrypoint script |
| presidio-anonymizer/entrypoint.sh | New entrypoint script for consistent container startup |
| presidio-anonymizer/Dockerfile* | Remove NAME arg references and update CMD syntax |
| presidio-analyzer/Dockerfile* | Remove NAME arg, consolidate package installs, add cache cleanup |
| docker-compose*.yml | Remove NAME build args and add registry cache references |
| .github/workflows/*.yml | Fix cache repository references to use correct registry paths |
Comments suppressed due to low confidence (1)
presidio-anonymizer/entrypoint.sh:3
- The entrypoint script should validate that the WORKERS and PORT environment variables are set and contain valid values before using them in the command execution.
#!/bin/sh
exec poetry run gunicorn -w "$WORKERS" -b "0.0.0.0:$PORT" "app:create_app()"
d831fc7 to
da9f6df
Compare
SharonHart
reviewed
Sep 21, 2025
SharonHart
reviewed
Sep 21, 2025
SharonHart
approved these changes
Sep 21, 2025
prokopidis
pushed a commit
to prokopidis/presidio
that referenced
this pull request
Jun 23, 2026
* fix docker cache * optimize docker files * fix up * remove NAME build arg * update ignore files * fix caching * / --------- Co-authored-by: Omri Mendels <omri374@users.noreply.github.com>
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.
Change Description
A few changes to optimize docker images:
Checklist