-
-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Add FrankenPHP
support with docker configuration and Caddyserver
setup.
#105
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
WalkthroughSupport 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
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
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ 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)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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 -dto 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
📒 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 indocker-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 nameyii2-frankenphp
correctly matches the service defined indocker-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 clickjackingX-XSS-Protection: 1; mode=block
enables XSS filteringX-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 toindex.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.
Summary by CodeRabbit