block-accounting/backend/docker-compose.yaml
2024-06-20 22:39:31 +03:00

130 lines
2.8 KiB
YAML

networks:
blockd-net:
name: blockd-net
driver: bridge
syslog:
name: syslog
driver: bridge
volumes:
blockd-data: {}
prometheus_data: {}
services:
blockd:
container_name: blockd
build:
context: .
dockerfile: ./Dockerfile
ports:
- 8081:8080
networks:
- blockd-net
- syslog
depends_on:
blockd-db:
condition: service_healthy
chain-api:
condition: service_started
profiles: [blockd]
chain-api:
container_name: chain-api
build:
context: ../chain-api
dockerfile: ../chain-api/Dockerfile
ports:
- 3000:3000
networks:
- blockd-net
- syslog
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-rmq:
image: rabbitmq:3.13.3-management
ports:
- 15672:15672
- 5672:5672
hostname: blockd-rmq
restart: always
environment:
- RABBITMQ_DEFAULT_USER=blockd
- RABBITMQ_DEFAULT_PASS=blockd
- RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbit disk_free_limit 2147483648
volumes:
- ./rabbitmq:/var/lib/rabbitmq
# 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: [metrics]
# 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: [metrics]
# syslog:
# image: linuxserver/syslog-ng:3.36.1
# container_name: syslog-ng
# environment:
# - PUID=0
# - PGID=0
# - TZ=UTC
# volumes:
# - /srv/syslog/config:/config
# - /srv/syslog/logs:/var/log
# ports:
# - 514:5514/udp
# - 601:6601/tcp
# - 6514:6514/tcp
# restart: unless-stopped
# networks:
# - syslog
# logging:
# driver: "json-file"
# profiles: [metrics]