Caddy-PHP: https://hub.docker.com/r/devcto/caddy-php
git clone https://github.com/jetsung/docker-caddy-php.git
# like: docker build --build-arg PHP_IMAGE_VER=8.1.0 -f Dockerfile -t caddy-php8.1 .
docker build --build-arg PHP_IMAGE_VER=8.1.0 -f Dockerfile -t caddy-php .
docker run -d -p 80:80 caddy-php
Pull the image from the docker index rather than downloading the git repo. This prevents you having to build the image on every docker host.
docker pull devcto/caddy-php:8.1version: '3'
services:
web:
image: devcto/caddy-php:8.1
restart: always
volumes:
- ./www:/var/www/html
- ./conf:/etc/caddy
ports:
- "80:80"To simply run the container:
docker run --name caddy-php -p 8080:80 -d caddy-php:8.1You can then browse to http://\<docker_host\>:8080 to view the default install files.
If you want to link to your web site directory on the docker host to the container run:
docker run --name caddy-php -p 8080:80 -v /your_code_directory:/var/www/html -v ./caddyfile_conf_directory:/etc/caddy -d caddy-php:8.1This project is licensed under the MIT license.