-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
43 lines (40 loc) · 1.65 KB
/
Copy pathdocker-compose.yml
File metadata and controls
43 lines (40 loc) · 1.65 KB
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
version: '3.8'
services:
# 1. The Core Application (FastAPI + RoBERTa Model)
api:
build: . # Builds the Dockerfile in current directory
container_name: reputation_api # Fixed name for easy reference
ports:
- "8000:7860" # Maps Host Port 8000 to Container Port 7860 (HF standard)
healthcheck: # Checks if API is responsive
test: ["CMD", "curl", "-f", "http://localhost:7860/health"]
interval: 30s
timeout: 10s
retries: 3
# 2. Metrics Collector (Prometheus)
prometheus:
image: prom/prometheus:latest # Uses official image
container_name: prometheus
ports:
- "9090:9090" # Web UI for Prometheus
volumes:
# Mount configuration file from local folder to container
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
command:
# Tell Prometheus where config file is
- '--config.file=/etc/prometheus/prometheus.yml'
depends_on:
- api # Wait for API to start before starting Prometheus
# 3. Visualization Dashboard (Grafana)
grafana:
image: grafana/grafana-oss:latest # Uses official OSS image
container_name: grafana
ports:
- "3000:3000" # Web UI for Grafana
volumes:
# Automate setup: Pre-configure Prometheus as data source
- ./monitoring/grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin # Default password for development
depends_on:
- prometheus # Grafana needs Prometheus to be ready