From 738828612ad950fcf8f92abf6f5eb6dba428854d Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Tue, 27 Dec 2022 00:12:21 +0900 Subject: [PATCH] add caddy service --- .env.example | 3 ++- compose.yml | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 6df5e56..d2d33f5 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,7 @@ +SERVER_HOST=gamma.fogtype.com DRONE_GITEA_SERVER=https://git.fogtype.com/ DRONE_GITEA_CLIENT_ID= DRONE_GITEA_CLIENT_SECRET= DRONE_RPC_SECRET= -DRONE_SERVER_HOST=gamma.fogtype.com +DRONE_SERVER_HOST=${SERVER_HOST} DRONE_SERVER_PROTO=https diff --git a/compose.yml b/compose.yml index 1b19928..f3d9043 100644 --- a/compose.yml +++ b/compose.yml @@ -1,12 +1,20 @@ services: - drone: - image: drone/drone:2 + caddy: + image: caddy:2.6.2-alpine@sha256:25a0097607868fb05a89a5ab9fea2f2ea4cecdc89d887d7dcee8c778a21b9e1f restart: unless-stopped ports: - "80:80" - - "443:443" + - "443:443/udp" + - "443:443/tcp" + - "127.0.0.1:2019:2019" + command: caddy reverse-proxy --from ${SERVER_HOST:?} --to http://drone + volumes: + - caddy_data:/data + - caddy_config:/config + drone: + image: drone/drone:2 + restart: unless-stopped environment: - DRONE_TLS_AUTOCERT: "true" DRONE_GITEA_SERVER: ${DRONE_GITEA_SERVER:?} DRONE_GITEA_CLIENT_ID: ${DRONE_GITEA_CLIENT_ID:?} DRONE_GITEA_CLIENT_SECRET: ${DRONE_GITEA_CLIENT_SECRET:?} @@ -29,4 +37,6 @@ services: volumes: - /var/run/docker.sock:/var/run/docker.sock volumes: + caddy_data: + caddy_config: drone_data_v2: