Files
NBA_Go/docker-compose.yml
2025-05-08 21:00:35 -05:00

104 lines
2.3 KiB
YAML
Raw Permalink 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.
version: '3.8'
services:
db-init:
build:
context: .
dockerfile: Dockerfile
volumes:
- './data:/app/data'
# now invoke your new subcommand
command: ["/nba_go", "import-data"]
restart: "no" # so it doesnt keep trying forever
healthcheck: # optional: mark healthy when the DB file exists
test: ["CMD", "test", "-f", "/app/data/nba.db"]
interval: 10s
timeout: 5s
retries: 3
networks:
- api.network
api1:
env_file: .env
volumes:
- './data:/app/data'
build: .
ports:
- '5001:5000'
restart: always
depends_on:
db-init:
condition: service_healthy
networks:
- api.network
api2:
env_file: .env
volumes:
- './data:/app/data'
build: .
ports:
- '5002:5000'
networks:
- api.network
api3:
env_file: .env
volumes:
- './data:/app/data'
build: .
ports:
- '5003:5000'
networks:
- api.network
nginx:
image: 'nginx:stable'
volumes:
- './nginx/nginx.conf:/etc/nginx/nginx.conf:ro'
depends_on:
- api1
- api2
- api3
ports:
- '8080:8080'
networks:
- api.network
prometheus:
image: 'prom/prometheus:latest'
volumes:
- './prometheus/prometheus.yml:/etc/prometheus/prometheus.yml'
- 'prometheus_data:/prometheus'
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
ports:
- '9090:9090'
networks:
- api.network
restart: unless-stopped
grafana:
image: grafana/grafana:latest
ports:
- '3001:3000'
environment:
- GF_SECURITY_ADMIN_PASSWORD=testing
volumes:
- './grafana/provisioning/datasources:/etc/grafana/provisioning/datasources'
- './grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards'
- './grafana/dashboards:/var/lib/grafana/dashboards'
- 'grafana_data:/var/lib/grafana'
networks:
- api.network
restart: unless-stopped
volumes:
prometheus_data: null
grafana_data: null
networks:
api.network: null