Last active
June 14, 2023 11:13
-
-
Save adriy-be/a7b9bdb13f79f94b92ef06c13d776499 to your computer and use it in GitHub Desktop.
Caddy php
This file contains hidden or 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
test.com:443 { | |
root * /app/html | |
file_server { | |
browse | |
} | |
php_fastcgi * localhost:9000 | |
} |
This file contains hidden or 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.6.4-builder-alpine AS builder | |
RUN xcaddy build \ | |
--with github.com/caddy-dns/cloudflare | |
FROM caddy:2.6.4-alpine AS caddyRun | |
ARG PUID="1000" | |
ARG PGID="1000" | |
RUN apk add --no-cache --update \ | |
openrc \ | |
php8 \ | |
php8-session \ | |
php8-curl \ | |
php8-json \ | |
php8-fpm \ | |
curl | |
RUN addgroup -g ${PGID} www-user && \ | |
adduser -D -H -u ${PUID} -G www-user www-user && \ | |
sed -i "s|^user = .*|user = www-user|g" /etc/php8/php-fpm.d/www.conf && \ | |
sed -i "s|^group = .*|group = www-user|g" /etc/php8/php-fpm.d/www.conf | |
COPY --from=builder /usr/bin/caddy /usr/bin/caddy | |
EXPOSE 80 | |
EXPOSE 443 | |
EXPOSE 2019 | |
VOLUME /etc/caddy | |
VOLUME /data/caddy/certificates | |
VOLUME /app/ | |
WORKDIR /app/ | |
COPY run.sh /usr/local/bin/ | |
RUN chmod +x /usr/local/bin/run.sh \ | |
&& ln -s /usr/local/bin/run.sh / | |
ENTRYPOINT [ "run.sh" ] |
This file contains hidden or 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
#!/bin/sh | |
php-fpm8 -D | |
caddy run --config /etc/caddy/Caddyfile --adapter caddyfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment