Skip to content

Conversation

terabytesoftw
Copy link
Member

@terabytesoftw terabytesoftw commented Jul 10, 2025

Q A
Is bugfix
New feature ✔️
Breaks BC

Summary by CodeRabbit

  • New Features
    • Added FrankenPHP as a supported environment, including Docker Compose configuration and server setup.
    • Updated documentation to include FrankenPHP usage instructions, badges, and access URLs.
  • Chores
    • Introduced a new CI job to test FrankenPHP integration.
    • Added configuration files for process management and server security in the FrankenPHP environment.

@terabytesoftw terabytesoftw added the enhancement New feature or request label Jul 10, 2025
Copy link

coderabbitai bot commented Jul 10, 2025

Walkthrough

Support for FrankenPHP as a new environment was introduced. This includes a dedicated Docker Compose configuration, Dockerfile, Caddyfile, and Supervisord setup for FrankenPHP, along with documentation updates and a new CI job for automated testing. Sensitive directory access and PHP execution in assets are explicitly restricted for security.

Changes

File(s) Change Summary
.github/workflows/docker.yml Added test-frankenphp CI job for FrankenPHP Docker Compose environment.
README.md Updated documentation to include FrankenPHP support, badge, usage, and directory structure.
docker-compose.frankenphp.yml New Docker Compose file defining yii2-frankenphp service and Caddy volumes for FrankenPHP.
docker/frankenphp/Dockerfile New Dockerfile for FrankenPHP, installing PHP extensions, Node.js, supervisord, and custom configs.
docker/frankenphp/Caddyfile New Caddyfile for FrankenPHP with security headers, static file serving, access restrictions, and rewrites.
docker/frankenphp/supervisord/supervisord.conf New supervisord main configuration for process management in FrankenPHP container.
docker/frankenphp/supervisord/conf.d/frankenphp.conf New supervisord program config to run FrankenPHP with Caddyfile.
docker/frankenphp/supervisord/conf.d/queue.conf New supervisord config for optional Yii2 queue worker process group.
docker/frankenphp/supervisord/log/.gitignore New .gitignore to exclude all files except itself in supervisord log directory.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant GitHub Actions
    participant Docker Engine
    participant FrankenPHP Container
    participant Supervisord
    participant Caddy/FrankenPHP

    Developer->>GitHub Actions: Push changes / PR
    GitHub Actions->>Docker Engine: Build & start yii2-frankenphp (docker-compose.frankenphp.yml)
    Docker Engine->>FrankenPHP Container: Start container
    FrankenPHP Container->>Supervisord: Start supervisord (nodaemon)
    Supervisord->>Caddy/FrankenPHP: Run frankenphp with Caddyfile
    GitHub Actions->>FrankenPHP Container: composer update, codecept build & run tests
Loading

Poem

In the warren of code, a new tunnel appears,
FrankenPHP hops in, and the crowd gives three cheers!
With Caddy and Supervisord, all in a row,
The tests run anew as the workflows now grow.
🐇 Here’s to fresh features, secure and robust—
In Docker we trust, as all rabbits must!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f3c71c0 and 44c75a0.

📒 Files selected for processing (2)
  • docker/frankenphp/Dockerfile (1 hunks)
  • docker/frankenphp/supervisord/conf.d/frankenphp.conf (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • docker/frankenphp/supervisord/conf.d/frankenphp.conf
  • docker/frankenphp/Dockerfile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
  • GitHub Check: easy-coding-standard / PHP 8.4-ubuntu-latest
  • GitHub Check: composer-require-checker / PHP 8.4-ubuntu-latest
  • GitHub Check: codeception / PHP 8.2-windows-latest
  • GitHub Check: codeception / PHP 8.4-windows-latest
  • GitHub Check: codeception / PHP 8.3-ubuntu-latest
  • GitHub Check: codeception / PHP 8.1-windows-latest
  • GitHub Check: codeception / PHP 8.2-ubuntu-latest
  • GitHub Check: codeception / PHP 8.1-ubuntu-latest
  • GitHub Check: test-nginx
  • GitHub Check: test-frankenphp
  • GitHub Check: test-apache
  • GitHub Check: test-apache
  • GitHub Check: codeception / PHP 8.4-windows-latest
  • GitHub Check: codeception / PHP 8.1-windows-latest
  • GitHub Check: codeception / PHP 8.1-ubuntu-latest
  • GitHub Check: codeception / PHP 8.2-windows-latest
  • GitHub Check: codeception / PHP 8.3-windows-latest
  • GitHub Check: test-nginx
  • GitHub Check: test-frankenphp

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Jul 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (0cdf064) to head (44c75a0).
Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##                main      #105   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity        36        36           
===========================================
  Files             23        23           
  Lines            621       621           
===========================================
  Hits             621       621           

☔ 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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (3)
README.md (2)

45-48: Double-check badge ordering and link validity.

The FrankenPHP badge is correctly added, but the list is now Apache → FrankenPHP → Nginx.
For consistency you may want to keep alphabetical (Apache → Nginx → FrankenPHP) or group HTTP-server types logically.
Minor, feel free to ignore.


104-107: Missing explicit port flag in the compose command.

docker-compose -f docker-compose.frankenphp.yml up -d starts the stack but newcomers might look for a -p name or explicit --build.
Consider:

-docker-compose -f docker-compose.frankenphp.yml up -d
+docker-compose -f docker-compose.frankenphp.yml up --build -d

to avoid stale images on first run.

docker/frankenphp/supervisord/conf.d/queue.conf (1)

1-14: Clarify optional nature of queue workers.

Not every project pulls in yii2-queue. Add an inactive example (commented) or explanatory note mirroring the Apache image convention so users aren’t surprised by failing queue commands.

 [program:yii-queue-worker]
+# Uncomment this program block only if you install yii2-queue

Small doc tweak prevents confusion.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between da6c355 and f3c71c0.

📒 Files selected for processing (9)
  • .github/workflows/docker.yml (1 hunks)
  • README.md (4 hunks)
  • docker-compose.frankenphp.yml (1 hunks)
  • docker/frankenphp/Caddyfile (1 hunks)
  • docker/frankenphp/Dockerfile (1 hunks)
  • docker/frankenphp/supervisord/conf.d/frankenphp.conf (1 hunks)
  • docker/frankenphp/supervisord/conf.d/queue.conf (1 hunks)
  • docker/frankenphp/supervisord/log/.gitignore (1 hunks)
  • docker/frankenphp/supervisord/supervisord.conf (1 hunks)
🧰 Additional context used
🧠 Learnings (6)
docker/frankenphp/supervisord/supervisord.conf (1)
Learnt from: terabytesoftw
PR: yii2-extensions/app-basic#102
File: docker/apache/Dockerfile:0-0
Timestamp: 2025-07-10T13:59:10.805Z
Learning: In docker/apache/Dockerfile, the queue.conf copy command is intentionally commented out because yii2-queue is optional. Users should uncomment the line `COPY docker/apache/supervisord/conf.d/queue.conf /etc/supervisor/conf.d/queue.conf` only if they install yii2-queue.
docker/frankenphp/supervisord/conf.d/queue.conf (1)
Learnt from: terabytesoftw
PR: yii2-extensions/app-basic#102
File: docker/apache/Dockerfile:0-0
Timestamp: 2025-07-10T13:59:10.805Z
Learning: In docker/apache/Dockerfile, the queue.conf copy command is intentionally commented out because yii2-queue is optional. Users should uncomment the line `COPY docker/apache/supervisord/conf.d/queue.conf /etc/supervisor/conf.d/queue.conf` only if they install yii2-queue.
README.md (1)
Learnt from: terabytesoftw
PR: yii2-extensions/app-basic#102
File: docker/apache/Dockerfile:0-0
Timestamp: 2025-07-10T13:59:10.805Z
Learning: In docker/apache/Dockerfile, the queue.conf copy command is intentionally commented out because yii2-queue is optional. Users should uncomment the line `COPY docker/apache/supervisord/conf.d/queue.conf /etc/supervisor/conf.d/queue.conf` only if they install yii2-queue.
docker/frankenphp/supervisord/conf.d/frankenphp.conf (1)
Learnt from: terabytesoftw
PR: yii2-extensions/app-basic#102
File: docker/apache/Dockerfile:0-0
Timestamp: 2025-07-10T13:59:10.805Z
Learning: In docker/apache/Dockerfile, the queue.conf copy command is intentionally commented out because yii2-queue is optional. Users should uncomment the line `COPY docker/apache/supervisord/conf.d/queue.conf /etc/supervisor/conf.d/queue.conf` only if they install yii2-queue.
docker-compose.frankenphp.yml (1)
Learnt from: terabytesoftw
PR: yii2-extensions/app-basic#102
File: docker/apache/Dockerfile:0-0
Timestamp: 2025-07-10T13:59:10.805Z
Learning: In docker/apache/Dockerfile, the queue.conf copy command is intentionally commented out because yii2-queue is optional. Users should uncomment the line `COPY docker/apache/supervisord/conf.d/queue.conf /etc/supervisor/conf.d/queue.conf` only if they install yii2-queue.
docker/frankenphp/Dockerfile (1)
Learnt from: terabytesoftw
PR: yii2-extensions/app-basic#102
File: docker/apache/Dockerfile:0-0
Timestamp: 2025-07-10T13:59:10.805Z
Learning: In docker/apache/Dockerfile, the queue.conf copy command is intentionally commented out because yii2-queue is optional. Users should uncomment the line `COPY docker/apache/supervisord/conf.d/queue.conf /etc/supervisor/conf.d/queue.conf` only if they install yii2-queue.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: codeception / PHP 8.1-windows-latest
  • GitHub Check: test-frankenphp
  • GitHub Check: test-frankenphp
🔇 Additional comments (17)
docker/frankenphp/supervisord/log/.gitignore (1)

1-2: Good use of negated pattern to keep the directory in Git.

The pattern is standard (* + !.gitignore) and prevents accidental log commits while preserving the folder.
No further action needed.

README.md (2)

122-124: Port 8082 can clash with existing local services.

If users already run another container on 8082 the quick-start will fail silently.
Add a note (as done for Apache/Nginx) explaining how to change the published port in docker-compose.frankenphp.yml.


142-143: Directory table update looks correct.

The docker/frankenphp/ entry is in the right spot and matches the new folder structure.

.github/workflows/docker.yml (1)

41-65: LGTM! Consistent CI job implementation.

The new test-frankenphp job follows the same pattern as existing CI jobs, ensuring consistency and maintainability. The container name yii2-frankenphp correctly matches the service defined in docker-compose.frankenphp.yml.

docker/frankenphp/Dockerfile (4)

1-7: LGTM! Proper base image and working directory setup.

The FrankenPHP base image version is specific and appropriate, and the working directory is correctly set to /app to align with Yii2 structure.


11-22: LGTM! Comprehensive PHP extensions for Yii2.

The selected PHP extensions are well-suited for Yii2 framework requirements:

  • Database support: pdo_mysql, pdo_pgsql
  • Image processing: gd, imagick, exif
  • Internationalization: intl
  • Performance: opcache
  • Development: xdebug
  • Utility: bcmath, zip, soap

28-35: LGTM! Proper package installation with cleanup.

The installation follows Docker best practices:

  • Uses --no-install-recommends to minimize image size
  • Includes proper cleanup of apt cache and temporary files
  • Uses official NodeSource repository for Node.js installation

43-44: LGTM! Consistent with optional queue configuration.

The commented queue.conf copy is consistent with the established pattern that yii2-queue is optional. Users should uncomment this line only if they install yii2-queue.

docker/frankenphp/Caddyfile (5)

1-4: LGTM! Appropriate global configuration.

Disabling auto HTTPS is correct for development/containerized environments where HTTPS termination may be handled elsewhere.


14-20: LGTM! Comprehensive security headers.

The security headers provide essential protection:

  • X-Frame-Options: SAMEORIGIN prevents clickjacking
  • X-XSS-Protection: 1; mode=block enables XSS filtering
  • X-Content-Type-Options: nosniff prevents MIME sniffing
  • Removing the Server header reduces information disclosure

38-48: LGTM! Excellent security measures for Yii2.

The access restrictions are well-implemented:

  • Blocking sensitive directories (.git, vendor, runtime, .env*) prevents exposure of sensitive files
  • Denying PHP execution in /assets directory is a crucial Yii2 security best practice that prevents potential code execution vulnerabilities

28-36: LGTM! Optimized static file handling.

The static file configuration provides good performance:

  • Comprehensive list of asset file extensions
  • One-year cache lifetime for static assets is appropriate
  • Proper use of file server directive

50-51: LGTM! Proper Yii2 URL rewriting.

The try_files directive correctly implements Yii2's URL rewriting pattern, falling back to index.php with query parameters preserved.

docker-compose.frankenphp.yml (4)

3-8: LGTM! Proper service configuration.

The service definition is well-structured:

  • Clear service name matching CI expectations
  • Correct Dockerfile path reference
  • Appropriate restart policy and working directory
  • Container name matches CI job usage

9-13: LGTM! Appropriate volume mounts.

The volume configuration is well-designed:

  • Application source mount for development
  • Composer cache mount with delegated consistency for better performance
  • Named volumes for Caddy data persistence

14-17: LGTM! Logical port mappings.

The port configuration is appropriate:

  • Port 8082 for HTTP traffic (avoiding conflicts with common ports)
  • Port 8443 for HTTPS with both TCP and UDP support (HTTP/3 compatibility)

23-25: LGTM! Necessary persistent volumes.

The named volumes are essential for Caddy's certificate management and configuration persistence across container restarts.

…ronment variable; modify supervisord config to specify user.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant