Files
xiaoxia-saas/infra/docker/compose.yml
T

60 lines
1.4 KiB
YAML

version: '3.8'
services:
api:
image: ${API_IMAGE:-xiaoxia-saas-api:dev}
build:
context: ../..
dockerfile: infra/docker/api.Dockerfile
container_name: xiaoxia-api-${ENV:-staging}
restart: unless-stopped
env_file:
- ../../.env
environment:
APP_ENV: ${APP_ENV:-staging}
ports:
- "${API_PORT:-8000}:8000"
networks:
- xiaoxia-net
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health', timeout=5)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
worker:
image: ${WORKER_IMAGE:-xiaoxia-saas-worker:dev}
build:
context: ../..
dockerfile: infra/docker/worker.Dockerfile
container_name: xiaoxia-worker-${ENV:-staging}
restart: unless-stopped
env_file:
- ../../.env
environment:
APP_ENV: ${APP_ENV:-staging}
networks:
- xiaoxia-net
web:
image: ${WEB_IMAGE:-xiaoxia-saas-web:dev}
build:
context: ../..
dockerfile: infra/docker/web.Dockerfile
container_name: xiaoxia-web-${ENV:-staging}
restart: unless-stopped
ports:
- "${WEB_PORT:-3001}:80"
networks:
- xiaoxia-net
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:80"]
interval: 30s
timeout: 5s
retries: 3
networks:
xiaoxia-net:
external: true