forked from pelican-dev/panel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cloudflare support to docker with Caddy
- Loading branch information
1 parent
6507548
commit 8e48822
Showing
5 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
admin off | ||
email {$ADMIN_EMAIL} | ||
} | ||
|
||
{$APP_URL} { | ||
root * /var/www/html/public | ||
encode gzip | ||
|
||
php_fastcgi 127.0.0.1:9000 | ||
file_server | ||
|
||
tls { | ||
dns cloudflare {$CLOUDFLARE_API_TOKEN} | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,9 @@ on: | |
push: | ||
tags: | ||
- "v*" | ||
|
||
release: | ||
types: | ||
- published | ||
jobs: | ||
build-and-push: | ||
name: Build and Push | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,11 +11,14 @@ RUN yarn config set network-timeout 300000 \ | |
&& yarn install --frozen-lockfile \ | ||
&& yarn run build:production | ||
|
||
FROM caddy:builder AS xcaddy | ||
RUN xcaddy build \ | ||
--with github.com/caddy-dns/cloudflare | ||
|
||
FROM php:8.3-fpm-alpine | ||
# FROM --platform=$TARGETOS/$TARGETARCH php:8.3-fpm-alpine | ||
|
||
ENV CADDY_ADMIN=off | ||
ENV [email protected] | ||
|
||
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer | ||
|
||
|
@@ -28,6 +31,9 @@ RUN apk update && apk add --no-cache \ | |
caddy ca-certificates supervisor \ | ||
&& docker-php-ext-install bcmath gd intl zip opcache pcntl posix pdo_mysql | ||
|
||
# Copy the binary with plugins | ||
COPY --from=xcaddy /usr/bin/caddy /usr/sbin/caddy | ||
|
||
# Copy the Caddyfile to the container | ||
COPY .github/docker/Caddyfile /etc/caddy/Caddyfile | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ x-common: | |
&panel-environment | ||
APP_URL: "https://localhost" # can be set to 'http://localhost' on port 80 only | ||
ADMIN_EMAIL: "[email protected]" | ||
CLOUDFLARE_API_TOKEN: "" # see https://pelican.dev/docs/guides/ssl#obtaining-cloudflare-api-token | ||
|
||
APP_DEBUG: "false" | ||
APP_ENVIRONMENT_ONLY: "false" | ||
|