Skip to content

Add COMPOSER_EXTRA_PACKAGES env var for runtime package installation in Docker#1138

Merged
jbtronics merged 6 commits into
masterfrom
copilot/add-composer-packages-env-var
Dec 7, 2025
Merged

Add COMPOSER_EXTRA_PACKAGES env var for runtime package installation in Docker#1138
jbtronics merged 6 commits into
masterfrom
copilot/add-composer-packages-env-var

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 7, 2025

Plan: Add support for installing additional composer packages in Docker containers

This addresses issue #1132 - allowing users to install additional mailer packages (like symfony/mailgun-mailer) without rebuilding the Docker image.

Checklist:

  • Explore repository structure and understand current Docker setup
  • Modify .docker/partdb-entrypoint.sh to support installing additional composer packages via env variable
  • Modify .docker/frankenphp/docker-entrypoint.sh for frankenphp support
  • Update Docker documentation (docs/installation/installation_docker.md) with instructions and examples
  • Review and verify the implementation
  • Address code review feedback (add shellcheck disable for intentional word splitting)
  • Run security checks
  • Store memory for future reference
  • Add documentation to email.md for both Docker and direct installation methods
  • Use proper composer workflow: --no-install with require, then separate install --no-dev

Implementation Summary

Added Features:

  1. COMPOSER_EXTRA_PACKAGES environment variable support in both Docker entrypoint scripts
  2. Automatic installation of specified packages at container startup using proper composer workflow
  3. Comprehensive documentation in both Docker installation guide and email configuration guide
  4. Production-safe: Uses two-step process - composer require --no-install followed by composer install --no-dev to prevent dev dependencies from being installed

Technical Implementation:

  • First runs composer require --no-install to update composer.json/composer.lock without installing
  • Then runs composer install --no-dev to install packages without dev dependencies
  • Proper error handling for both steps with clear error messages

Documentation Updates:

  • Added section in docs/installation/email.md explaining how to install additional mailer packages for both Docker and direct installation
  • Includes examples for Mailgun, SendGrid, Brevo, Amazon SES, and Postmark
  • Provides step-by-step instructions for both deployment methods
Original prompt

Add an environmental var to allow additional composer packages inside of docker containers and add documentation about it.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits December 7, 2025 13:23
…ontainers

Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>
Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>
Copilot AI changed the title [WIP] Add environment variable for additional composer packages Add COMPOSER_EXTRA_PACKAGES env var for runtime package installation in Docker Dec 7, 2025
Copilot AI requested a review from jbtronics December 7, 2025 13:28
@jbtronics
Copy link
Copy Markdown
Member

@copilot Add documentation on how to use it to the email documentation page, and also add text how to install a package when Part-DB is directly installed (not inside docker)

Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Dec 7, 2025

@copilot Add documentation on how to use it to the email documentation page, and also add text how to install a package when Part-DB is directly installed (not inside docker)

Added documentation to docs/installation/email.md with instructions for both Docker and direct installation methods. The documentation includes examples for common mailer packages (Mailgun, SendGrid, Brevo, Amazon SES, Postmark) and step-by-step commands for both deployment scenarios. (0444d4e)

@jbtronics
Copy link
Copy Markdown
Member

@copilot Ensure that no dev packages get installed

@jbtronics
Copy link
Copy Markdown
Member

This fixes issue #1132

…ation

Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Dec 7, 2025

@copilot Ensure that no dev packages get installed

Added --no-dev flag to both entrypoint scripts to ensure only production dependencies are installed. (562e477)

@jbtronics
Copy link
Copy Markdown
Member

@copilot --no-dev does not work with require. Use --no-install and run an install command afterwards

Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Dec 7, 2025

@copilot --no-dev does not work with require. Use --no-install and run an install command afterwards

Changed to use --no-install with composer require followed by a separate composer install --no-dev command. (e12bf57)

@jbtronics jbtronics marked this pull request as ready for review December 7, 2025 17:38
@jbtronics jbtronics merged commit 0ac23cd into master Dec 7, 2025
19 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.33%. Comparing base (60ff727) to head (e12bf57).
⚠️ Report is 17 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1138      +/-   ##
============================================
- Coverage     58.34%   58.33%   -0.02%     
  Complexity     7286     7286              
============================================
  Files           580      580              
  Lines         23193    23193              
============================================
- Hits          13533    13530       -3     
- Misses         9660     9663       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jbtronics jbtronics deleted the copilot/add-composer-packages-env-var branch March 5, 2026 00:18
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.

2 participants