feat: Adds caddy.
This commit is contained in:
3
caddy/.env
Normal file
3
caddy/.env
Normal file
@@ -0,0 +1,3 @@
|
||||
ACME_EMAIL="admin@example.com"
|
||||
CF_AUTH_TOKEN="my-token"
|
||||
CF_EMAIL="admin@example.com"
|
||||
7
caddy/Dockerfile
Normal file
7
caddy/Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
||||
FROM caddy:2.9.1-builder AS builder
|
||||
|
||||
RUN xcaddy build \
|
||||
--with github.com/caddy-dns/cloudflare
|
||||
|
||||
FROM caddy:2.9.1-alpine
|
||||
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
|
||||
34
caddy/compose.yml
Normal file
34
caddy/compose.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
|
||||
volumes:
|
||||
caddy_config:
|
||||
caddy_data:
|
||||
|
||||
services:
|
||||
caddy:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: caddy
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- CLOUDFLARE_EMAIL=${CF_EMAIL}
|
||||
- CLOUDFLARE_API_TOKEN=${CF_AUTH_TOKEN}
|
||||
- ACME_AGREE=true
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
- "443:443/udp"
|
||||
- 2019:2019
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
volumes:
|
||||
- $PWD/config:/etc/caddy
|
||||
- caddy_data:/data
|
||||
- caddy_config:/config
|
||||
networks:
|
||||
- proxy
|
||||
20
caddy/config/Caddyfile
Normal file
20
caddy/config/Caddyfile
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
email {env.ACME_EMAIL}
|
||||
acme_dns cloudflare {env.CF_AUTH_TOKEN}
|
||||
admin 0.0.0.0:2019
|
||||
}
|
||||
|
||||
*.housh.dev {
|
||||
tls {
|
||||
dns cloudflare {env.CF_AUTH_TOKEN}
|
||||
propagation_delay 2m
|
||||
resolvers 1.1.1.1
|
||||
}
|
||||
|
||||
# example of reverse proxy.
|
||||
|
||||
@gitea host git.housh.dev
|
||||
handle @gitea {
|
||||
reverse_proxy 192.168.10.76:3000
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user