docker build -t caddy-php .
docker run -p 8080:8080 caddy-php
Created
July 8, 2021 16:06
-
-
Save Baldinof/9adf039d9edabc0001dea3abafb6764f to your computer and use it in GitHub Desktop.
PHP-fpm with Caddy web server
This file contains 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
{ | |
supervisor { | |
php-fpm | |
} | |
} | |
:8080 | |
php_fastcgi 127.0.0.1:9000 | |
root * . | |
encode gzip | |
file_server |
This file contains 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
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"] |
This file contains 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
<?php | |
echo "Hello from PHP"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment