nex_buddy/docker-compose.yml

44 lines
1.1 KiB
YAML

name: nex-buddy
services:
api:
build:
context: .
dockerfile: docker/Dockerfile.api
args:
APT_MIRROR: "${APT_MIRROR:-mirrors.tuna.tsinghua.edu.cn}"
PIP_INDEX_URL: "${PIP_INDEX_URL:-https://pypi.tuna.tsinghua.edu.cn/simple}"
image: nex-buddy-api:latest
init: true
env_file:
- .env
environment:
DATA_DIR: /app/data
FORWARDED_ALLOW_IPS: "*"
WEB_CONCURRENCY: "${WEB_CONCURRENCY:-2}"
volumes:
- "${NEX_BUDDY_DATA_DIR:-./data}:/app/data"
expose:
- "8100"
restart: unless-stopped
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8100/healthz', timeout=3)"]
interval: 10s
timeout: 5s
retries: 20
start_period: 30s
web:
build:
context: .
dockerfile: docker/Dockerfile.web
args:
NPM_REGISTRY: "${NPM_REGISTRY:-https://registry.npmmirror.com}"
image: nex-buddy-web:latest
ports:
- "${HTTP_PORT:-80}:80"
depends_on:
api:
condition: service_healthy
restart: unless-stopped