Merged Caddy into docker-compose and added edge CORS handling

This commit is contained in:
2026-02-10 21:34:54 +08:00
parent e83bb522a4
commit 36530eb2c5
2 changed files with 44 additions and 10 deletions

View File

@@ -1,20 +1,34 @@
services:
api:
ai-gateway:
build: .
container_name: ai-gateway
networks:
- caddy_network
#ports:
# - "8000:8000"
- ai_network
env_file:
- .env
restart: always
caddy:
image: caddy:latest
container_name: caddy
restart: always
ports:
- "80:80"
- "443:443"
- "443:443/udp"
networks:
- ai_network
volumes:
- .:/app
# Override command for development/auto-reload if needed
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
depends_on:
- ai-gateway
networks:
caddy_network:
# Define the network at the bottom
external: true
ai_network:
driver: bridge
volumes:
caddy_data:
caddy_config: