Skip to content

Repository files navigation

edge-docker-php

Provided Software

  • FrankenPHP (PHP + Caddy)
  • Composer

Configuration Options

Most configuration can be done with environment variables. Here are some of the available non-standard options:

EnvironmentDefaultDescription
PHP_DISPLAY_ERRORSOffDisplay PHP errors in the browser, not recommended for production
PHP_OPCACHE_VALIDATEOffForces OPcache to check for updates on every request, turn Off for production
PHP_TIMEZONEEurope/LondonSpecify the PHP date.timezone
PHP_MEMORY_LIMIT2GSpecify the PHP memory limit
WEB_ROOT/var/wwwSet's the web server root directory
WEB_PUBLIC-A suffix to the WEB_ROOT to only serve files from this location
SMTP_HOSTsmtp.mailtrap.ioSet SMTP hostname (uses MSMTP for sendmail)
SMTP_PORT2525Set SMTP port
SMTP_USER-Set SMTP username
SMTP_FROM-Set SMTP envelope-from header
SMTP_PASS-Set SMTP password
SMTP_TLSOnEnable TLS support, by default STARTTLS is enabled on port 587
SMTP_CHECK_CERTSOnSpecifying Off will disable SMTP TLS certificate checks

FrankenPHP Configuration

This repo publishes outeredge/edge-docker-php:8.3-frankenphp and :8.4-frankenphp. These variants run FrankenPHP (Caddy + PHP, single process) and are intended for Google Cloud Run and similar serverless container platforms.

There are also -frankenphp-super variants that use supervisor to run FrankenPHP alongside sidecars like Valkey and Google Cloud SQL Proxy.

EnvironmentDefaultDescription
CADDY_ADMINoffCaddy admin API socket (e.g. localhost:2019 for live inspection)
CADDY_AUTO_HTTPSoffTLS strategy: on for ACME certs, off for upstream termination (Cloud Run, etc.)
CADDY_GLOBAL_OPTIONS-Global escape hatch for debug or custom order directives
CADDY_EXTRA_CONFIG-Top-level escape hatch for named snippets or additional sites
CADDY_SERVER_EXTRA_DIRECTIVES-Extra directives/overrides (e.g. header, basicauth, X-Robots-Tag)
CADDY_CONFdefaultApp-specific config from /etc/caddy/conf.d/${CADDY_CONF}.caddy
CADDY_ENCODINGSzstd br gzipSpace-separated list of compression encodings
FRANKENPHP_CONFIG-Runtime tuning, e.g. num_threads 8 or worker /var/www/public/index.php 4
MAX_REQUEST_SIZE32MBMaximum inbound request body size (Cloud Run limit is 32MB)
PORT8080Note, services like Cloud Run set this automatically
SERVER_NAME:$PORTThe domain or port to bind to (e.g. app.example.com)

To add app-level Caddy rules, drop a file at $WEB_ROOT/Caddyfile - it is imported automatically.

What's different

  • Single process (standard variant): FrankenPHP runs as PID 1. No supervisord, no PHP-FPM, no cron, no SSH, no Valkey sidecar, no sudo.
  • Supervisor variant (-frankenphp-super): Runs supervisord as PID 1 with Valkey and Cloud SQL Proxy included.
  • Runs as non-root user edge with CAP_NET_BIND_SERVICE removed - cannot bind privileged ports.
  • Read-only-rootfs friendly.
  • Debian base image.

Additional Site Blocks

To add entirely new site blocks (e.g. for an admin domain, metrics endpoint, or monitoring), drop .caddyfile files into /etc/caddy/Caddyfile.d/. These are imported at the top level, outside of the primary site block.

About

Base docker image for running PHP web applications

Topics

Resources

Stars

9 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages