A fork of caddy:2.8-alpine with this specific Caddyfile to use it with a PHP Docker service:
localhost:443, {$SERVER_NAME}:443 {
root * /var/www/html/public
php_fastcgi php:9000
file_server
}
How to use in a docker-compose.yml file:
version: "3"
services:
caddy:
image: dmnlouis/caddy:2.8
environment:
SERVER_NAME: ${SERVER_NAME} //Don't forget to add this env var
restart: unless-stopped
volumes:
- ./:/var/www/html
- caddy_data:/data
- caddy_config:/config
ports:
- "80:80"
- "443:443"
Integration with dmnlouis/php:
#docker-compose.yml
version: "3"
services:
php:
image: dmnlouis/php:8.3
restart: unless-stopped
volumes:
- ./:/var/www/html
caddy:
image: dmnlouis/caddy:2.8
links:
- php
depends_on:
- php
environment:
SERVER_NAME: ${SERVER_NAME} //Don't forget to add this env var
restart: unless-stopped
volumes:
- ./:/var/www/html
- caddy_data:/data
- caddy_config:/config
ports:
- "80:80"
- "443:443"
volumes:
caddy_data: {}
caddy_config: {}
Content type
Image
Digest
sha256:15856a3ab…
Size
17.8 MB
Last updated
over 2 years ago
docker pull dmnlouis/caddy