Files
EvoBGP/deploy/compose/docker-compose.yaml
T

194 lines
4.9 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# EvoBGP Compose: профили `reference` (эталон) и `microvps` (одна VPS).
#
# Запуск:
# docker compose --profile reference up -d --build
# docker compose --profile microvps up -d --build
#
# Профиль reference: Web UI на http://localhost:3000 (nginx → /v1 и /metrics на evobgp-api:8080).
#
# Очистка неиспользуемых данных Docker (PowerShell; осторожно с -v):
# docker system prune -f
# docker volume prune -f
#
# Входящий BGP (TCP/179): на Linux для публичного пира часто нужен network_mode: host у bird2
# или macvlan/ipvlan — см. архитектурный план §4.1. Здесь опубликован порт 179 для отладки.
name: evobgp
x-logging: &default-logging
driver: json-file
options:
max-size: "10m"
max-file: "3"
services:
postgres:
profiles: ["reference", "microvps"]
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: evobgp
POSTGRES_PASSWORD: evobgp
POSTGRES_DB: evobgp
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U evobgp -d evobgp"]
interval: 10s
timeout: 5s
retries: 5
logging: *default-logging
deploy:
resources:
limits:
cpus: "1.0"
memory: 384M
evobgp-api:
profiles: ["reference"]
build:
context: ../..
dockerfile: deploy/docker/gobinary/Dockerfile
args:
BIN: evobgp-api
INSTALL_BIRDC: "1"
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
bird2:
condition: service_started
ports:
- "8080:8080"
environment:
EVOBGP_HTTP_ADDR: ":8080"
EVOBGP_SEED_DEMO: "1"
EVOBGP_BIRDC_SOCKET: /run/bird/bird.ctl
EVOBGP_BIRDC_INTERVAL: 30s
# Для прямого доступа к API с dev-сервера Vite (порт 5173); в Docker UI трафик идёт через evobgp-web proxy.
EVOBGP_CORS_ORIGINS: "http://localhost:5173,http://127.0.0.1:5173,http://localhost:3000,http://127.0.0.1:3000"
volumes:
- bird_run:/run/bird:ro
logging: *default-logging
deploy:
resources:
limits:
cpus: "1.0"
memory: 512M
evobgp-web:
profiles: ["reference"]
build:
context: ../..
dockerfile: deploy/docker/evobgp-web/Dockerfile
restart: unless-stopped
depends_on:
- evobgp-api
ports:
- "3000:80"
logging: *default-logging
deploy:
resources:
limits:
cpus: "0.5"
memory: 128M
evobgp-all:
profiles: ["microvps"]
build:
context: ../..
dockerfile: deploy/docker/gobinary/Dockerfile
args:
BIN: evobgp-all
INSTALL_BIRDC: "1"
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
bird2:
condition: service_started
ports:
- "8080:8080"
environment:
EVOBGP_HTTP_ADDR: ":8080"
EVOBGP_SEED_DEMO: "1"
EVOBGP_BIRDC_SOCKET: /run/bird/bird.ctl
EVOBGP_BIRDC_INTERVAL: 30s
volumes:
- bird_run:/run/bird:ro
logging: *default-logging
deploy:
resources:
limits:
cpus: "1.0"
memory: 512M
bird2:
profiles: ["reference", "microvps"]
build:
context: ../..
dockerfile: deploy/docker/bird2/Dockerfile
restart: unless-stopped
cap_add:
- NET_ADMIN
sysctls:
net.ipv4.ip_forward: "1"
net.ipv6.conf.all.forwarding: "1"
volumes:
- bird_etc:/etc/bird
- bird_run:/run/bird
ports:
- "179:179/tcp"
logging: *default-logging
deploy:
resources:
limits:
memory: 256M
evobgp-agent:
profiles: ["reference", "microvps"]
build:
context: ../..
dockerfile: deploy/docker/evobgp-agent/Dockerfile
restart: unless-stopped
depends_on:
- bird2
cap_add:
- NET_ADMIN
volumes:
- bird_etc:/etc/bird
- bird_run:/run/bird
entrypoint: ["/bin/sh", "-c"]
command: ["sleep infinity"]
logging: *default-logging
deploy:
resources:
limits:
memory: 128M
prometheus:
profiles: ["reference"]
image: prom/prometheus:v2.54.1
restart: unless-stopped
depends_on:
- evobgp-api
ports:
- "9090:9090"
volumes:
- ../prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ../prometheus/alerts.yml:/etc/prometheus/alerts.yml:ro
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention.time=15d
- --web.enable-lifecycle
logging: *default-logging
deploy:
resources:
limits:
memory: 512M
volumes:
pgdata:
bird_etc:
bird_run: