96 lines
2.7 KiB
YAML
96 lines
2.7 KiB
YAML
|
|
version: '3.8'
|
||
|
|
|
||
|
|
services:
|
||
|
|
calejo-control-adapter:
|
||
|
|
build:
|
||
|
|
context: .
|
||
|
|
dockerfile: Dockerfile
|
||
|
|
container_name: calejo-control-adapter
|
||
|
|
ports:
|
||
|
|
- "8080:8080" # REST API
|
||
|
|
# OPC UA and Modbus ports are not exposed in production
|
||
|
|
# as we use external SCADA servers
|
||
|
|
- "9090:9090" # Prometheus metrics
|
||
|
|
env_file:
|
||
|
|
- .env.production
|
||
|
|
depends_on:
|
||
|
|
- postgres
|
||
|
|
restart: unless-stopped
|
||
|
|
healthcheck:
|
||
|
|
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
||
|
|
interval: 30s
|
||
|
|
timeout: 10s
|
||
|
|
retries: 3
|
||
|
|
start_period: 30s
|
||
|
|
volumes:
|
||
|
|
- ./logs:/app/logs
|
||
|
|
- ./config:/app/config
|
||
|
|
networks:
|
||
|
|
- calejo-network
|
||
|
|
|
||
|
|
postgres:
|
||
|
|
image: postgres:15
|
||
|
|
container_name: calejo-postgres
|
||
|
|
environment:
|
||
|
|
- POSTGRES_DB=calejo_production
|
||
|
|
- POSTGRES_USER=calejo_user
|
||
|
|
- POSTGRES_PASSWORD=production_password
|
||
|
|
ports:
|
||
|
|
- "5432:5432"
|
||
|
|
volumes:
|
||
|
|
- postgres_data:/var/lib/postgresql/data
|
||
|
|
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
|
||
|
|
restart: unless-stopped
|
||
|
|
networks:
|
||
|
|
- calejo-network
|
||
|
|
|
||
|
|
prometheus:
|
||
|
|
image: prom/prometheus:latest
|
||
|
|
container_name: calejo-prometheus
|
||
|
|
ports:
|
||
|
|
- "9091:9090"
|
||
|
|
volumes:
|
||
|
|
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
|
||
|
|
- ./monitoring/web.yml:/etc/prometheus/web.yml
|
||
|
|
- ./monitoring/alert_rules.yml:/etc/prometheus/alert_rules.yml
|
||
|
|
- prometheus_data:/prometheus
|
||
|
|
command:
|
||
|
|
- '--config.file=/etc/prometheus/prometheus.yml'
|
||
|
|
- '--web.config.file=/etc/prometheus/web.yml'
|
||
|
|
- '--storage.tsdb.path=/prometheus'
|
||
|
|
- '--web.console.libraries=/etc/prometheus/console_libraries'
|
||
|
|
- '--web.console.templates=/etc/prometheus/consoles'
|
||
|
|
- '--storage.tsdb.retention.time=200h'
|
||
|
|
- '--web.enable-lifecycle'
|
||
|
|
restart: unless-stopped
|
||
|
|
networks:
|
||
|
|
- calejo-network
|
||
|
|
|
||
|
|
grafana:
|
||
|
|
image: grafana/grafana:latest
|
||
|
|
container_name: calejo-grafana
|
||
|
|
ports:
|
||
|
|
- "3000:3000"
|
||
|
|
environment:
|
||
|
|
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD:-admin}
|
||
|
|
- GF_USERS_ALLOW_SIGN_UP=false
|
||
|
|
volumes:
|
||
|
|
- grafana_data:/var/lib/grafana
|
||
|
|
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards
|
||
|
|
- ./monitoring/grafana/datasources:/etc/grafana/provisioning/datasources
|
||
|
|
- ./monitoring/grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/dashboard.yml
|
||
|
|
- ./monitoring/grafana/dashboards:/etc/grafana/provisioning/dashboards
|
||
|
|
restart: unless-stopped
|
||
|
|
depends_on:
|
||
|
|
- prometheus
|
||
|
|
networks:
|
||
|
|
- calejo-network
|
||
|
|
|
||
|
|
volumes:
|
||
|
|
postgres_data:
|
||
|
|
prometheus_data:
|
||
|
|
grafana_data:
|
||
|
|
|
||
|
|
networks:
|
||
|
|
calejo-network:
|
||
|
|
driver: bridge
|