Files
ai-chess/docker-compose.yml

57 lines
1.4 KiB
YAML

# Deploy: docker compose up -d --build (on serv, in /opt/chessai)
# The app talks to cli-proxy-api directly over caddy-network (no public hop, no RKN).
services:
db:
image: postgres:17-alpine
container_name: chessai-db
restart: unless-stopped
logging:
driver: json-file
options: { max-size: "20m", max-file: "5" }
environment:
POSTGRES_USER: chess
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-chess}
POSTGRES_DB: chess
volumes:
- ./pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U chess"]
interval: 5s
retries: 20
chessai:
build:
context: .
network: host
args:
http_proxy: ${BUILD_PROXY:-}
https_proxy: ${BUILD_PROXY:-}
HTTP_PROXY: ${BUILD_PROXY:-}
HTTPS_PROXY: ${BUILD_PROXY:-}
image: chessai:latest
container_name: chessai
restart: unless-stopped
logging:
driver: json-file
options: { max-size: "20m", max-file: "5" }
depends_on:
db:
condition: service_healthy
env_file: .env
environment:
DATABASE_URL: postgres://chess:${POSTGRES_PASSWORD:-chess}@db:5432/chess
HOST: 0.0.0.0
PORT: "7833"
volumes:
- ./data:/data
networks:
default:
caddy-network:
aliases:
- chessai
networks:
caddy-network:
external: true
name: caddy-network