Freeunit#3
Merged
Merged
Conversation
Contributor
samdark
commented
May 30, 2026
| Q | A |
|---|---|
| Is bugfix? | ✔️/❌ |
| New feature? | ✔️/❌ |
| Breaks BC? | ✔️/❌ |
| Fixed issues | comma-separated list of tickets # fixed by the PR, if any |
- Change base image from dunglas/frankenphp to ghcr.io/freeunitorg/freeunit:latest-php8.5 - Replace Caddyfile configurations with Unit JSON configuration for Yii2 - Add unit-config.json for development and production environments - Update Dockerfile to use Unit control socket directory instead of Caddy directories - Configure Unit routes and applications according to Yii2 framework requirements per https://docs.freeunit.org/howto/yii/
🚀 Key Changes Runtime Replacement: Switched the base Docker image from dunglas/frankenphp to ghcr.io/freeunitorg/freeunit:latest-php8.5. Server Architecture: Removed Caddy and FrankenPHP dependencies. FreeUnit now acts as the standalone web server handling HTTP requests and PHP execution directly. Configuration: Added unit-config.json for both dev and prod environments, configured according to FreeUnit documentation for Yii. Enabled dynamic configuration loading via /docker-entrypoint.d. Docker Compose Updates: Simplified networking by removing Caddy-specific networks and labels. Exposed port 80 directly from the application container. Removed persistent volumes for Caddy data/config. 🛠 Technical Details Base Image: ghcr.io/freeunitorg/freeunit:latest-php8.5 User Permissions: Configured to run under the unit user with appropriate write access to runtime directories. Dev Environment: Includes debug settings and direct access to the Unit control socket for easier development and testing. 📖 References FreeUnit Documentation Yii Integration Guide FreeUnit GitHub (pre-1.35.5) ✅ Testing Please verify that the application starts correctly using docker compose up and that HTTP requests are served properly by the FreeUnit runtime in both development and production modes.
There was a problem hiding this comment.
Pull request overview
Switches the PHP runtime in the Docker images from FrankenPHP (Caddy-based) to Unit (freeunit distribution). The web server configuration is migrated from Caddyfiles to NGINX Unit JSON configs, and the production compose file moves from a Caddy reverse-proxy network model to directly exposing port 80.
Changes:
- Replace
dunglas/frankenphpbase image withghcr.io/freeunitorg/freeunit:latest-php8.5and update permission/chown setup for Unit's control socket. - Add
docker/unit-config.json(prod) anddocker/dev/unit-config.json(dev) to replace the removed Caddyfiles; both route*.phpto a direct PHP target and static files via ashareaction with fallback toindex.php. - Drop the Caddy reverse-proxy wiring in
docker/prod/compose.yml(caddy_public network, caddy labels, caddy_data/caddy_config volumes) and expose port 80 directly.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| docker/Dockerfile | Switches base image to freeunit, installs curl, replaces FrankenPHP capability/chown setup with Unit runtime dirs, copies Unit JSON configs. |
| docker/unit-config.json | New Unit production config with PHP routing. |
| docker/dev/unit-config.json | New Unit dev config (identical to prod). |
| docker/dev/Caddyfile | Removed (replaced by Unit config). |
| docker/Caddyfile | Removed (replaced by Unit config). |
| docker/compose.yml | Removes caddy_data/caddy_config volumes. |
| docker/prod/compose.yml | Removes caddy network/labels/volumes; publishes port 80 directly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.