add caddy-fastapi

Signed-off-by: Grant Birkinbine <grantbirki@github.com>
This commit is contained in:
Grant Birkinbine
2022-03-16 23:25:14 -07:00
parent 05095bbe0d
commit 2dfb65746b
10 changed files with 262 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
# To build the entire stack run 'make run'
version: '3.7'
services:
fastapi:
container_name: fastapi
restart: unless-stopped
build:
context: ./src/fastapi
dockerfile: ./Dockerfile
ports:
- 8000:8000
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 5m
timeout: 5s
retries: 3
start_period: 15s
caddy:
container_name: caddy
restart: unless-stopped
build:
context: ./src/caddy
dockerfile: ./Dockerfile
ports:
- 80:80
- 443:443
volumes:
- ./data/caddy_data:/data
- ./data/caddy_config:/config
depends_on:
- fastapi
environment:
PROXY_BACKEND: fastapi
PROXY_PORT: 8000
DOMAIN: ${DOMAIN}
volumes:
caddy_data:
caddy_config: