block-accounting/backend/docker-compose.yaml

85 lines
1.8 KiB
YAML
Raw Normal View History

2024-05-24 17:44:24 +00:00
version: '3'
networks:
blockd-net:
name: blockd-net
driver: bridge
volumes:
blockd-data: {}
prometheus_data: {}
services:
blockd:
container_name: blockd
image: blockd:latest
ports:
- 8080:8080
networks:
- blockd-net
depends_on:
blockd-db:
condition: service_healthy
profiles: [blockd]
blockd-db:
container_name: blockd-db
image: postgres:16
restart: always
environment:
- POSTGRES_USER=blockd
- POSTGRES_PASSWORD=blockd
- POSTGRES_DB=blockd
volumes:
- blockd-data:/var/lib/postgresql/data
- ./migrations/blockd.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- 8432:5432
networks:
- blockd-net
healthcheck:
test: pg_isready -U blockd -d blockd
interval: 1s
timeout: 5s
retries: 10
start_period: 5s
profiles: [blockd, database, noback]
blockd-cache:
container_name: blockd-cache
image: redis:7.2.4
restart: always
networks:
- blockd-net
ports:
- 6379:6379
profiles: [blockd, database, noback]
prometheus:
image: prom/prometheus
container_name: prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
ports:
- 9091:9090
restart: unless-stopped
networks:
- blockd-net
volumes:
- ./prometheus:/etc/prometheus
- prometheus_data:/prometheus
profiles: [blockd, metrics, noback]
grafana:
image: grafana/grafana
container_name: grafana
ports:
- 3112:3000
restart: unless-stopped
networks:
- blockd-net
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=grafana
volumes:
- ./grafana:/etc/grafana/provisioning/datasources
profiles: [blockd, metrics, noback]