-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
171 lines (162 loc) · 4.63 KB
/
Copy pathdocker-compose.yml
File metadata and controls
171 lines (162 loc) · 4.63 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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# SkyLink - Docker Compose Configuration
# Launch all services with: docker compose up -d
services:
# API Gateway - Main entry point (port 8000)
gateway:
build:
context: .
dockerfile: Dockerfile.gateway
ports:
- "8000:8000"
environment:
- ENVIRONMENT=development
- LOG_LEVEL=INFO
- PRIVATE_KEY_PEM=${PRIVATE_KEY_PEM}
- PUBLIC_KEY_PEM=${PUBLIC_KEY_PEM}
- TELEMETRY_SERVICE_URL=http://telemetry:8001
- WEATHER_SERVICE_URL=http://weather:8002
- CONTACTS_SERVICE_URL=http://contacts:8003
depends_on:
telemetry:
condition: service_healthy
weather:
condition: service_healthy
contacts:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 10s
timeout: 3s
retries: 3
start_period: 10s
networks:
- skylink-net
# Telemetry Service - Aircraft telemetry ingestion (port 8001)
telemetry:
build:
context: .
dockerfile: Dockerfile.telemetry
environment:
- ENVIRONMENT=development
- LOG_LEVEL=INFO
- PUBLIC_KEY_PEM=${PUBLIC_KEY_PEM}
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8001/health')"]
interval: 10s
timeout: 3s
retries: 3
start_period: 5s
networks:
- skylink-net
# Weather Service - Weather data (port 8002)
weather:
build:
context: .
dockerfile: Dockerfile.weather
environment:
- ENVIRONMENT=development
- LOG_LEVEL=INFO
- DEMO_MODE=true
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8002/health')"]
interval: 10s
timeout: 3s
retries: 3
start_period: 5s
networks:
- skylink-net
# Contacts Service - Google contacts integration (port 8003)
contacts:
build:
context: .
dockerfile: Dockerfile.contacts
environment:
- ENVIRONMENT=development
- LOG_LEVEL=INFO
- DEMO_MODE=true
- DATABASE_URL=postgresql://skylink:skylink@db:5432/skylink
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8003/health')"]
interval: 10s
timeout: 3s
retries: 3
start_period: 5s
networks:
- skylink-net
# PostgreSQL Database - For contacts OAuth tokens
db:
image: postgres:16-alpine
environment:
- POSTGRES_USER=skylink
- POSTGRES_PASSWORD=skylink
- POSTGRES_DB=skylink
healthcheck:
test: ["CMD-SHELL", "pg_isready -U skylink -d skylink"]
interval: 5s
timeout: 3s
retries: 3
networks:
- skylink-net
# Prometheus - Metrics collection (port 9090)
# Enable with: docker compose --profile monitoring up -d
prometheus:
image: prom/prometheus:v2.47.0
container_name: prometheus
profiles:
- monitoring
volumes:
- ./monitoring/prometheus:/etc/prometheus:ro
- 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'
- '--web.enable-lifecycle'
ports:
- "9090:9090"
networks:
- skylink-net
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:9090/-/healthy"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
# Grafana - Visualization (port 3000)
# Enable with: docker compose --profile monitoring up -d
grafana:
image: grafana/grafana:10.2.0
container_name: grafana
profiles:
- monitoring
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-admin}
- GF_USERS_ALLOW_SIGN_UP=false
- GF_SERVER_ROOT_URL=http://localhost:3000
volumes:
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning:ro
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards:ro
- grafana_data:/var/lib/grafana
ports:
- "3000:3000"
networks:
- skylink-net
depends_on:
- prometheus
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://localhost:3000/api/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
volumes:
prometheus_data:
grafana_data:
networks:
skylink-net:
driver: bridge