-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpodman-compose.yml
More file actions
172 lines (163 loc) · 4.34 KB
/
podman-compose.yml
File metadata and controls
172 lines (163 loc) · 4.34 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
# Podman Compose for HAProxy + FlexGate
# High-performance setup for >10K req/sec
# Run with: podman-compose up -d
# Or use Makefile: make start
version: '3.8'
services:
# HAProxy - High-performance data plane
haproxy:
image: haproxy:2.8-alpine
container_name: flexgate-haproxy
ports:
- "8080:8080" # HTTP
- "8443:8443" # HTTPS
- "8404:8404" # Stats page
volumes:
- ./haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
- ./haproxy/errors:/etc/haproxy/errors:ro
- ./haproxy/certs:/etc/haproxy/certs:ro
networks:
- flexgate-network
depends_on:
- flexgate-app-1
- flexgate-app-2
restart: unless-stopped
healthcheck:
test: ["CMD", "haproxy", "-c", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]
interval: 10s
timeout: 5s
retries: 3
deploy:
resources:
limits:
cpus: '2'
memory: 1G
reservations:
cpus: '1'
memory: 512M
# FlexGate App - Instance 1 (Control Plane + Backend)
flexgate-app-1:
image: localhost/flexgate-proxy:latest
container_name: flexgate-app-1
environment:
- NODE_ENV=production
- PORT=3000
- DATABASE_URL=postgresql://flexgate:flexgate@postgres:5432/flexgate
- REDIS_URL=redis://redis:6379
- INSTANCE_ID=app-1
networks:
- flexgate-network
depends_on:
- postgres
- redis
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 5s
timeout: 3s
retries: 3
deploy:
resources:
limits:
cpus: '1'
memory: 512M
# FlexGate App - Instance 2 (Backup)
flexgate-app-2:
image: localhost/flexgate-proxy:latest
container_name: flexgate-app-2
environment:
- NODE_ENV=production
- PORT=3001
- DATABASE_URL=postgresql://flexgate:flexgate@postgres:5432/flexgate
- REDIS_URL=redis://redis:6379
- INSTANCE_ID=app-2
networks:
- flexgate-network
depends_on:
- postgres
- redis
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001/health"]
interval: 5s
timeout: 3s
retries: 3
deploy:
resources:
limits:
cpus: '1'
memory: 512M
# PostgreSQL - Configuration database
postgres:
image: postgres:15-alpine
container_name: flexgate-postgres
environment:
- POSTGRES_DB=flexgate
- POSTGRES_USER=flexgate
- POSTGRES_PASSWORD=flexgate
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- flexgate-network
restart: unless-stopped
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
# Redis - Session cache and rate limiting
redis:
image: redis:7-alpine
container_name: flexgate-redis
command: redis-server --maxmemory 256mb --maxmemory-policy allkeys-lru
networks:
- flexgate-network
restart: unless-stopped
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
# Prometheus - Metrics collection
prometheus:
image: prom/prometheus:latest
container_name: flexgate-prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=7d'
volumes:
- ./infra/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
ports:
- "9090:9090"
networks:
- flexgate-network
restart: unless-stopped
# Admin UI - FlexGate Management Dashboard
admin-ui:
image: localhost/flexgate-admin-ui:latest
container_name: flexgate-admin-ui
environment:
- NODE_ENV=production
# Admin UI is served by nginx (static files)
# Browser makes API calls directly to HAProxy (client-side)
# REACT_APP_API_URL not needed - browser uses http://localhost:8080
ports:
- "3002:3000"
networks:
- flexgate-network
depends_on:
- haproxy
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health"]
interval: 10s
timeout: 5s
retries: 3
networks:
flexgate-network:
driver: bridge
volumes:
postgres-data:
prometheus-data: