86 lines
2.2 KiB
YAML
86 lines
2.2 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_DB: configcenter
|
|
POSTGRES_USER: configcenter
|
|
POSTGRES_PASSWORD: configcenter
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U configcenter -d configcenter"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 20
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
|
|
etcd:
|
|
image: quay.io/coreos/etcd:v3.5.17
|
|
command:
|
|
- /usr/local/bin/etcd
|
|
- --name=etcd-1
|
|
- --data-dir=/etcd-data
|
|
- --listen-client-urls=http://0.0.0.0:2379
|
|
- --advertise-client-urls=http://etcd:2379
|
|
healthcheck:
|
|
test: ["CMD", "etcdctl", "endpoint", "health"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 20
|
|
volumes:
|
|
- etcd-data:/etcd-data
|
|
|
|
server:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
environment:
|
|
HTTP_ADDR: :8080
|
|
DATABASE_URL: postgres://configcenter:configcenter@postgres:5432/configcenter?sslmode=disable
|
|
ETCD_ENDPOINTS: http://etcd:2379
|
|
CORS_ALLOWED_ORIGINS: http://localhost:5173
|
|
AUTH_ENABLED: ${AUTH_ENABLED:-false}
|
|
JWT_SECRET: ${JWT_SECRET:-}
|
|
JWT_TTL: ${JWT_TTL:-8h}
|
|
BOOTSTRAP_ADMIN_USERNAME: ${BOOTSTRAP_ADMIN_USERNAME:-admin}
|
|
BOOTSTRAP_ADMIN_PASSWORD: ${BOOTSTRAP_ADMIN_PASSWORD:-}
|
|
BOOTSTRAP_ADMIN_DISPLAY_NAME: ${BOOTSTRAP_ADMIN_DISPLAY_NAME:-Administrator}
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
etcd:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:8080/health/ready"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 20
|
|
ports:
|
|
- "18080:8080"
|
|
|
|
web:
|
|
build:
|
|
context: .
|
|
dockerfile: web/Dockerfile
|
|
depends_on:
|
|
server:
|
|
condition: service_healthy
|
|
ports:
|
|
- "5173:80"
|
|
|
|
prometheus:
|
|
image: prom/prometheus:v3.2.1
|
|
profiles: ["monitoring"]
|
|
command: ["--config.file=/etc/prometheus/prometheus.yml"]
|
|
volumes:
|
|
- ./deploy/monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
|
- ./deploy/monitoring/alerts.yml:/etc/prometheus/alerts.yml:ro
|
|
depends_on:
|
|
server:
|
|
condition: service_healthy
|
|
ports:
|
|
- "9090:9090"
|
|
|
|
volumes:
|
|
postgres-data:
|
|
etcd-data:
|