Files
ai-ops/docker-compose.single.yml
2026-05-12 17:48:22 +08:00

61 lines
2.0 KiB
YAML

services:
postgres:
image: ${AI_OPS_POSTGRES_IMAGE:-docker.io/library/postgres:16-alpine}
container_name: ${AI_OPS_PROJECT:-ai-ops-single}-postgres
environment:
POSTGRES_USER: ${AI_OPS_DB_USER:-aiops}
POSTGRES_PASSWORD: ${AI_OPS_DB_PASSWORD:-aiops123}
POSTGRES_DB: ${AI_OPS_DB_NAME:-ai_ops}
ports:
- "${AI_OPS_BIND_ADDR:-127.0.0.1}:${AI_OPS_DB_PORT:-15432}:5432"
volumes:
- single_postgres_data:/var/lib/postgresql/data
- ./tech/migrations:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${AI_OPS_DB_USER:-aiops} -d ${AI_OPS_DB_NAME:-ai_ops}"]
interval: 5s
timeout: 5s
retries: 12
restart: unless-stopped
redis:
image: ${AI_OPS_REDIS_IMAGE:-docker.io/library/redis:8-alpine}
container_name: ${AI_OPS_PROJECT:-ai-ops-single}-redis
ports:
- "${AI_OPS_BIND_ADDR:-127.0.0.1}:${AI_OPS_REDIS_PORT:-16379}:6379"
volumes:
- single_redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 12
restart: unless-stopped
ai-ops:
image: ${AI_OPS_RUNTIME_IMAGE:-docker.io/library/alpine:3.19}
container_name: ${AI_OPS_PROJECT:-ai-ops-single}-app
working_dir: /app
command: ["/app/ai-ops"]
ports:
- "${AI_OPS_BIND_ADDR:-127.0.0.1}:${AI_OPS_APP_PORT:-18080}:8080"
environment:
AI_OPS_CONFIG: /app/config.yaml
AI_OPS_SERVER_JWT_SECRET: ${AI_OPS_JWT_SECRET:?AI_OPS_JWT_SECRET is required}
AI_OPS_SERVER_METRICS_AUTH: ${AI_OPS_METRICS_AUTH:?AI_OPS_METRICS_AUTH is required}
AI_OPS_DATABASE_PASSWORD: ${AI_OPS_DB_PASSWORD:-aiops123}
volumes:
- ./.runtime/ai-ops:/app/ai-ops:ro
- ./.runtime/config.single.yaml:/app/config.yaml:ro
- ./static:/app/static:ro
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
volumes:
single_postgres_data:
single_redis_data: