Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Refactor Dockerfile to use templates#11

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
guillaume-sainthillier wants to merge1 commit intomain
base:main
Choose a base branch
Loading
fromclaude/dockerfile-templates-01J3urTGADGc3AH56tmCiVpY

Conversation

@guillaume-sainthillier
Copy link
Member

Introduce a template-based architecture that significantly reduces code duplication and improves maintainability across all PHP variants.

What Changed

New Template System

  • Add CUE schema for version and variant configuration (templates/versions.cue)
  • Add validation rules and constraints (templates/validation.cue)
  • Add automated test suite for configuration validation (templates/test.sh)
  • Add Python-based generator script (templates/generate.py)

Dockerfile Templates

  • Create 4 reusable templates instead of maintaining 36+ individual files:
    • Dockerfile.base.tmpl - Apache + PHP on Debian
    • Dockerfile.symfony.tmpl - Symfony-optimized variant
    • Dockerfile.ci.tmpl - Alpine-based CI variant
    • Dockerfile.frankenphp.tmpl - FrankenPHP with Caddy

Build System Updates

  • Update Makefile with new targets: validate, test, generate
  • Integrate CUE validation into build process
  • Maintain backward compatibility with existing build commands

Documentation

  • Add comprehensive template system documentation (templates/README.md)
  • Update main README with template architecture overview
  • Include contributor quick start guide

Benefits

  • ✅ Reduced code duplication: 4 templates vs 36+ Dockerfiles
  • ✅ Guaranteed consistency across all variants
  • ✅ Built-in validation prevents configuration errors
  • ✅ Easy to add new PHP versions or variants
  • ✅ Single source of truth for all configurations
  • ✅ Faster development and maintenance

Technical Details

  • Uses CUE language for type-safe configuration
  • Generates byte-for-byte identical Dockerfiles
  • Validates version constraints (e.g., FrankenPHP >= 8.2)
  • Ensures proper legacy flags and latest tags
  • Automated testing of all configuration rules

All existing Dockerfiles remain functionally identical.

@guillaume-sainthillierguillaume-sainthillierforce-pushed theclaude/dockerfile-templates-01J3urTGADGc3AH56tmCiVpY branch 4 times, most recently from6632da4 to9855c4cCompareNovember 23, 2025 14:49
Replace 36+ individual Dockerfiles with a template-based system usingPython, Jinja2, and YAML configuration. All variants now use mlocati'sinstall-php-extensions for consistent dependency management.Architecture:- YAML configuration (templates/config.yaml) - Single source of truth- Configuration validation (templates/validate_config.py) - Schema validation- Jinja2 templates (4 files) - Base, Symfony, CI, FrankenPHP variants- Generation script (templates/generate.py) - Automates creationKey improvements:- Use install-php-extensions (mlocati) for all PHP extension installations- Automatic dependency handling across all PHP versions- No manual --with-libzip or PHPIZE_DEPS configuration needed- Support for legacy packages (iputils-ping, libicu-dev for PHP 5.6-7.3)- Debian Stretch repository updates for PHP 7.1-7.3Benefits:- 4 templates instead of 36+ Dockerfiles- YAML configuration with validation- Guaranteed consistency across all images- Simplified extension management with mlocati- Easy to add new PHP versions or variantsBug fixes:- FrankenPHP Bookworm now uses apt-get instead of apk- Debian Stretch repository updates for archived versionsUsage:  make validate  # Validate configuration  make generate  # Generate all Dockerfiles  make build     # Build all images
@guillaume-sainthillierguillaume-sainthillierforce-pushed theclaude/dockerfile-templates-01J3urTGADGc3AH56tmCiVpY branch from9855c4c to4056349CompareNovember 23, 2025 14:59
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@guillaume-sainthillier@claude

[8]ページ先頭

©2009-2025 Movatter.jp