File size: 3,585 Bytes
39d224b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b413138
 
 
 
 
c2c8d10
b413138
 
 
 
c2c8d10
 
 
 
 
 
 
 
 
 
 
 
 
b413138
 
739e446
d15bf61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
739e446
d15bf61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39d224b
 
 
 
 
 
 
d15bf61
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
services:
  hopcroft-api:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: hopcroft-api
    ports:
      - "8080:8080"
    env_file:
      - .env
    environment:
      - PROJECT_NAME=Hopcroft
    volumes:
      # Bind mount: enables live code reloading for development
      - ./hopcroft_skill_classification_tool_competition:/app/hopcroft_skill_classification_tool_competition
      # Named volume: persistent storage for application logs
      - hopcroft-logs:/app/logs
    networks:
      - hopcroft-net
    # Override CMD for development with auto-reload
    command: >
      uvicorn hopcroft_skill_classification_tool_competition.main:app  --host 0.0.0.0  --port 8080  --reload
    restart: unless-stopped
    healthcheck:
      test: [ "CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8080/health', timeout=5)" ]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s

  hopcroft-gui:
    build:
      context: .
      dockerfile: Dockerfile.streamlit
    container_name: hopcroft-gui
    ports:
      - "8501:8501"
    environment:
      - API_BASE_URL=http://hopcroft-api:8080
    volumes:
      # Bind mount for development hot-reload
      - ./hopcroft_skill_classification_tool_competition/streamlit_app.py:/app/streamlit_app.py
    networks:
      - hopcroft-net
    depends_on:
      hopcroft-api:
        condition: service_healthy
    restart: unless-stopped

  prometheus:
    image: prom/prometheus:latest
    container_name: prometheus
    volumes:
      - ./monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
      - ./monitoring/prometheus/alert_rules.yml:/etc/prometheus/alert_rules.yml
    ports:
      - "9090:9090"
    networks:
      - hopcroft-net
    depends_on:
      - alertmanager
    restart: unless-stopped

  alertmanager:
    image: prom/alertmanager:latest
    container_name: alertmanager
    volumes:
      - ./monitoring/alertmanager/config.yml:/etc/alertmanager/config.yml
    ports:
      - "9093:9093"
    networks:
      - hopcroft-net
    restart: unless-stopped

  grafana:
    image: grafana/grafana:latest
    container_name: grafana
    ports:
      - "3000:3000"
    environment:
      - GF_SECURITY_ADMIN_USER=admin
      - GF_SECURITY_ADMIN_PASSWORD=admin
      - GF_USERS_ALLOW_SIGN_UP=false
      - GF_SERVER_ROOT_URL=http://localhost:3000
    volumes:
      # Provisioning: auto-configure datasources and dashboards
      - ./monitoring/grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
      - ./monitoring/grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards
      - ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards
      # Persistent storage for Grafana data
      - grafana-data:/var/lib/grafana
    networks:
      - hopcroft-net
    depends_on:
      - prometheus
    restart: unless-stopped
    healthcheck:
      test: ["CMD-SHELL", "curl -f http://localhost:3000/api/health || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 3

  pushgateway:
    image: prom/pushgateway:latest
    container_name: pushgateway
    ports:
      - "9091:9091"
    networks:
      - hopcroft-net
    restart: unless-stopped
    command:
      - '--web.listen-address=:9091'
      - '--persistence.file=/data/pushgateway.data'
      - '--persistence.interval=5m'
    volumes:
      - pushgateway-data:/data


networks:
  hopcroft-net:
    driver: bridge

volumes:
  hopcroft-logs:
    driver: local
  grafana-data:
    driver: local
  pushgateway-data:
    driver: local