-
Notifications
You must be signed in to change notification settings - Fork 1
Optimize Docker build context to fix slow compose up times in Copilot sessions #254
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
Conversation
…235KB Co-authored-by: dannystaple <426859+dannystaple@users.noreply.github.com>
Co-authored-by: dannystaple <426859+dannystaple@users.noreply.github.com>
… from build Co-authored-by: dannystaple <426859+dannystaple@users.noreply.github.com>
Co-authored-by: dannystaple <426859+dannystaple@users.noreply.github.com>
@copilot for reference, my desktop can perform a fresh set up in 1 minute and 57 seconds.
However my desktop does have a lot of power:
Can you profile and evaluate the timing of the base |
I've completed a comprehensive performance profile and analysis of the current Docker optimization. Key Findings:
Performance Comparison: The optimization eliminates context transfer bottlenecks (235KB vs 525MB) and provides consistent performance across environments. The npm ci and webpack compilation phases will be similar regardless of optimization. I've created benchmark scripts and detailed analysis - the Docker architecture successfully addresses the original 425MB context transfer issue while preserving all functionality. |
🦙 MegaLinter status: ❌ ERROR
See detailed report in MegaLinter reports |
🐳 Docker Base Image AvailableA new base Docker image has been built and pushed for this PR: Image: How to use this image:# Pull the image
docker pull ghcr.io/orionrobots/orionrobots-site.base:254
# Run with the image
docker run -it ghcr.io/orionrobots/orionrobots-site.base:254 bash For local development:You can use this image as a base for testing changes without rebuilding dependencies. This comment is automatically updated when the base image is rebuilt. |
Co-authored-by: dannystaple <426859+dannystaple@users.noreply.github.com>
This PR resolves the performance issue where
docker compose up
was taking excessively long times in GitHub Copilot sessions due to transferring a 425MB build context, compared to only 4MB locally.Problem
The Docker build was transferring the entire repository content (425MB) including:
galleries/
(210MB)content/
(153MB)_image_sources/
(119MB)This caused slow startup times in fresh environments like GitHub Copilot sessions, even though development services use volume mounts and don't need this content during the build phase.
Solution
Created an optimized Docker architecture:
New Files
dev.Dockerfile
- Minimal dockerfile that only installs npm dependenciesKey Changes
serve
,dist
,build
,shell
) to usedev.Dockerfile
.dockerignore
to exclude large content directories from build context--prefer-offline --no-audit --progress=false
Dockerfile
for production services that need full content.eleventyignore
entry to prevent documentation files from being built into sitePerformance Improvements
Architecture
Development Services (use
dev.Dockerfile
):.:/app/src
)Production Services (use full
Dockerfile
):httpd_serve
,staging
,test
servicesThe development workflow remains unchanged -
docker compose up
works exactly the same but starts much faster.Fixes #253.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.