-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
198 lines (184 loc) · 4.97 KB
/
docker-compose.yml
File metadata and controls
198 lines (184 loc) · 4.97 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
version: '3.9'
services:
# PostgreSQL database
postgres:
image: postgres:16-alpine
container_name: streamspace-postgres
environment:
POSTGRES_DB: streamspace
POSTGRES_USER: streamspace
POSTGRES_PASSWORD: streamspace
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U streamspace"]
interval: 10s
timeout: 5s
retries: 5
networks:
- streamspace
# NATS message broker for event-driven architecture
nats:
image: nats:2.10-alpine
container_name: streamspace-nats
command:
- "--jetstream"
- "--store_dir=/data"
- "--http_port=8222"
ports:
- "4222:4222" # Client connections
- "8222:8222" # HTTP monitoring
- "6222:6222" # Cluster routing
volumes:
- nats-data:/data
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8222/healthz"]
interval: 10s
timeout: 5s
retries: 5
networks:
- streamspace
restart: unless-stopped
# StreamSpace API Backend
api:
build:
context: ./api
dockerfile: Dockerfile
args:
VERSION: ${VERSION:-dev}
COMMIT: ${COMMIT:-local}
BUILD_DATE: ${BUILD_DATE}
container_name: streamspace-api
depends_on:
postgres:
condition: service_healthy
nats:
condition: service_healthy
environment:
# Database configuration
DB_HOST: postgres
DB_PORT: 5432
DB_USER: streamspace
DB_PASSWORD: streamspace
DB_NAME: streamspace
# API configuration
API_PORT: 8000
GIN_MODE: debug
# JWT configuration
JWT_SECRET: dev-secret-change-in-production
# NATS configuration
NATS_URL: nats://nats:4222
NATS_USER: ""
NATS_PASSWORD: ""
PLATFORM: kubernetes
# Sync configuration
SYNC_INTERVAL: 1h
# Kubernetes config (when running outside cluster)
# KUBECONFIG: /root/.kube/config
ports:
- "8000:8000"
volumes:
# Mount kubeconfig for local development (optional)
# - ~/.kube:/root/.kube:ro
- /tmp/streamspace-repos:/tmp/streamspace-repos
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8000/health"]
interval: 30s
timeout: 3s
retries: 3
networks:
- streamspace
restart: unless-stopped
# StreamSpace Docker Controller (for Docker platform support)
docker-controller:
build:
context: ./docker-controller
dockerfile: Dockerfile
container_name: streamspace-docker-controller
depends_on:
nats:
condition: service_healthy
environment:
NATS_URL: nats://nats:4222
NATS_USER: ""
NATS_PASSWORD: ""
CONTROLLER_ID: streamspace-docker-controller-1
DOCKER_NETWORK: streamspace
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- streamspace
profiles:
- docker
restart: unless-stopped
# pgAdmin for database management (optional, for development)
pgadmin:
image: dpage/pgadmin4:latest
container_name: streamspace-pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: admin@streamspace.local
PGADMIN_DEFAULT_PASSWORD: admin
PGADMIN_CONFIG_SERVER_MODE: 'False'
ports:
- "5050:80"
volumes:
- pgadmin-data:/var/lib/pgadmin
networks:
- streamspace
profiles:
- dev
restart: unless-stopped
# Prometheus for metrics (optional, for development)
prometheus:
image: prom/prometheus:latest
container_name: streamspace-prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
networks:
- streamspace
profiles:
- monitoring
restart: unless-stopped
# Grafana for dashboards (optional, for development)
grafana:
image: grafana/grafana:latest
container_name: streamspace-grafana
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: admin
GF_USERS_ALLOW_SIGN_UP: 'false'
ports:
- "3000:3000"
volumes:
- grafana-data:/var/lib/grafana
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning:ro
networks:
- streamspace
profiles:
- monitoring
restart: unless-stopped
networks:
streamspace:
name: streamspace
driver: bridge
volumes:
postgres-data:
name: streamspace-postgres-data
nats-data:
name: streamspace-nats-data
pgadmin-data:
name: streamspace-pgadmin-data
prometheus-data:
name: streamspace-prometheus-data
grafana-data:
name: streamspace-grafana-data