-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
87 lines (82 loc) · 3.1 KB
/
Copy pathdocker-compose.yml
File metadata and controls
87 lines (82 loc) · 3.1 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
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
# docker-compose.yml
services:
# ── Backend (FastAPI) ────────────────────────────────────────────────────────
backend:
build:
context: .
dockerfile: docker/Dockerfile.backend
container_name: cloudscope-backend
restart: unless-stopped
ports:
- "8000:8000"
environment:
- PYTHONUNBUFFERED=1
- LOG_LEVEL=info
- EC2_MONITORING_ENABLED=${EC2_MONITORING_ENABLED:-false}
- EC2_DISPLAY_NAME=${EC2_DISPLAY_NAME:-AWS EC2}
- EC2_REGION=${EC2_REGION:-us-east-1}
- EC2_HOST=${EC2_HOST:-}
- EC2_PORT=${EC2_PORT:-22}
- EC2_USERNAME=${EC2_USERNAME:-}
- EC2_SSH_KEY_PATH=${EC2_SSH_KEY_PATH_CONTAINER:-/run/secrets/ec2-key.pem}
- EC2_SSH_PASSWORD=${EC2_SSH_PASSWORD:-}
- EC2_CONNECT_TIMEOUT=${EC2_CONNECT_TIMEOUT:-8}
- EC2_COMMAND_TIMEOUT=${EC2_COMMAND_TIMEOUT:-10}
networks:
- cloudscope-net
healthcheck:
test: ["CMD", "python", "-c",
"import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 15s
timeout: 5s
retries: 3
start_period: 10s
volumes:
- logs:/app/logs
- ${EC2_SSH_KEY_DIR_HOST:-./data/keys}:/run/secrets:ro
# ── Dashboard (Streamlit) ────────────────────────────────────────────────────
dashboard:
build:
context: .
dockerfile: docker/Dockerfile.dashboard
container_name: cloudscope-dashboard
restart: unless-stopped
command: >
streamlit run ui/dashboard.py
--server.port 8501
--server.address 0.0.0.0
--server.headless true
--browser.gatherUsageStats false
ports:
- "8501:8501"
environment:
- BACKEND_URL=${BACKEND_URL:-http://backend:8000}
- POLL_SECONDS=${POLL_SECONDS:-5}
- PYTHONUNBUFFERED=1
depends_on:
backend:
condition: service_healthy # waits for /health to pass, not just container start
networks:
- cloudscope-net
# ── Simulator (background metric generator) ──────────────────────────────────
simulator:
build:
context: .
dockerfile: docker/Dockerfile.simulator
container_name: cloudscope-simulator
restart: unless-stopped
command: python simulator/simulator.py
environment:
- PYTHONUNBUFFERED=1
depends_on:
backend:
condition: service_healthy
networks:
- cloudscope-net
# ── Shared network ────────────────────────────────────────────────────────────
networks:
cloudscope-net:
driver: bridge
# ── Named volumes ─────────────────────────────────────────────────────────────
volumes:
logs: