Skip to content

Instantly share code, notes, and snippets.

@Baldinof
Created July 8, 2021 16:06
Show Gist options
  • Save Baldinof/9adf039d9edabc0001dea3abafb6764f to your computer and use it in GitHub Desktop.
Save Baldinof/9adf039d9edabc0001dea3abafb6764f to your computer and use it in GitHub Desktop.
PHP-fpm with Caddy web server
docker build -t caddy-php .
docker run -p 8080:8080 caddy-php
{
supervisor {
php-fpm
}
}
:8080
php_fastcgi 127.0.0.1:9000
root * .
encode gzip
file_server
FROM caddy:2-builder AS builder
RUN xcaddy build --with github.com/baldinof/caddy-supervisor
FROM php:8.0-fpm-alpine
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
COPY Caddyfile .
COPY index.php .
CMD ["caddy", "run"]
<?php
echo "Hello from PHP";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment