Caddy now owns ports 80/443 and reverse-proxies to the frontend container (which was publishing 80 itself, conflicting with Caddy), handling Let's Encrypt certificate issuance/renewal automatically. Fix the Caddyfile's upstream name (it referenced a nonexistent "app" service instead of "frontend") and update the Lightsail deploy guide's HTTPS section to match this setup instead of the old manual-certbot approach.
44 lines
886 B
YAML
44 lines
886 B
YAML
services:
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
restart: unless-stopped
|
|
env_file:
|
|
- ./backend/.env
|
|
environment:
|
|
# SQLite ファイルと知識ベースを永続ボリュームに置く(.env の値を上書き)
|
|
DATABASE_URL: sqlite:////app/data/playchat.db
|
|
volumes:
|
|
- backend_data:/app/data
|
|
- backend_knowledge_base:/app/knowledge_base
|
|
expose:
|
|
- "8000"
|
|
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- backend
|
|
expose:
|
|
- "80"
|
|
|
|
caddy:
|
|
image: caddy:latest
|
|
restart: unless-stopped
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./Caddyfile:/etc/caddy/Caddyfile
|
|
- caddy_data:/data
|
|
- caddy_config:/config
|
|
depends_on:
|
|
- frontend
|
|
|
|
volumes:
|
|
backend_data:
|
|
backend_knowledge_base:
|
|
caddy_data:
|
|
caddy_config:
|