Files
NBA_Go/docker-compose.yml
T
2025-06-20 00:34:30 -05:00

94 lines
2.2 KiB
YAML

# Note: The 'version' attribute is obsolete in modern Docker Compose and has been removed.
services:
# --- The local postgres service is disabled for production deployment ---
# postgres:
# ...
# Add "import-data" back into commands for DB import.
db-init:
build: .
env_file: .env
command: ["/nba_go"]
networks:
- api.network
restart: "no"
api1:
build: .
env_file: .env
# --- MODIFICATION ---
# The API services do not need to be exposed directly.
# Nginx will handle routing to them internally.
networks:
- api.network
restart: always
api2:
build: .
env_file: .env
networks:
- api.network
restart: always
api3:
build: .
env_file: .env
networks:
- api.network
restart: always
nginx:
image: 'nginx:stable'
volumes:
- './nginx/nginx.conf:/etc/nginx/nginx.conf:ro'
depends_on:
- api1
- api2
- api3
# --- MODIFICATION ---
# We EXPOSE the container port, but do not PUBLISH it to the host.
# Coolify's proxy will connect to this internal port.
ports:
- "8080"
networks:
- api.network
prometheus:
image: 'prom/prometheus:latest'
volumes:
- './prometheus:/etc/prometheus'
- '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'
# --- MODIFICATION ---
# Expose the internal port for the proxy.
ports:
- "9090"
networks:
- api.network
restart: unless-stopped
grafana:
image: grafana/grafana:latest
ports:
# --- MODIFICATION ---
# Expose the internal port for the proxy.
- "3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=testing
volumes:
- './grafana/provisioning:/etc/grafana/provisioning'
- './grafana/dashboards:/var/lib/grafana/dashboards'
- 'grafana_data:/var/lib/grafana'
networks:
- api.network
restart: unless-stopped
volumes:
prometheus_data:
grafana_data:
networks:
api.network: null