forked from BrainTease/Brain-Storm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.staging.yml
More file actions
163 lines (154 loc) · 4.06 KB
/
Copy pathdocker-compose.staging.yml
File metadata and controls
163 lines (154 loc) · 4.06 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
version: '3.8'
# Staging environment — mirrors production config but uses staging secrets
# and reduced resource limits. Start with:
# docker compose -f docker-compose.staging.yml up -d
services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: brain-storm-staging
POSTGRES_USER: ${STAGING_DATABASE_USER:-brain-storm-staging}
POSTGRES_PASSWORD: ${STAGING_DATABASE_PASSWORD}
volumes:
- postgres_staging_data:/var/lib/postgresql/data
networks:
- brain-storm-staging
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${STAGING_DATABASE_USER:-brain-storm-staging}']
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
redis:
image: redis:7-alpine
restart: unless-stopped
command: redis-server --appendonly yes
volumes:
- redis_staging_data:/data
networks:
- brain-storm-staging
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 10s
timeout: 3s
retries: 5
deploy:
resources:
limits:
cpus: '0.25'
memory: 256M
backend:
image: ${STAGING_BACKEND_IMAGE:-ghcr.io/braintease/brain-storm/backend:staging}
restart: unless-stopped
ports:
- '3000:3000'
environment:
NODE_ENV: staging
PORT: 3000
DATABASE_HOST: postgres
DATABASE_PORT: 5432
DATABASE_USER: ${STAGING_DATABASE_USER:-brain-storm-staging}
DATABASE_PASSWORD: ${STAGING_DATABASE_PASSWORD}
DATABASE_NAME: brain-storm-staging
REDIS_HOST: redis
REDIS_PORT: 6379
JWT_SECRET: ${STAGING_JWT_SECRET}
SENTRY_DSN: ${STAGING_SENTRY_DSN}
STELLAR_NETWORK: testnet
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- brain-storm-staging
healthcheck:
test: ['CMD-SHELL', 'wget -qO- http://localhost:3000/health || exit 1']
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
frontend:
image: ${STAGING_FRONTEND_IMAGE:-ghcr.io/braintease/brain-storm/frontend:staging}
restart: unless-stopped
ports:
- '3001:3001'
environment:
NODE_ENV: staging
NEXT_PUBLIC_API_URL: ${STAGING_API_URL:-http://backend:3000}
depends_on:
backend:
condition: service_healthy
networks:
- brain-storm-staging
healthcheck:
test: ['CMD-SHELL', 'wget -qO- http://localhost:3001/api/health || exit 1']
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
prometheus:
image: prom/prometheus:latest
restart: unless-stopped
volumes:
- ./infra/monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_staging_data:/prometheus
ports:
- '9090:9090'
networks:
- brain-storm-staging
deploy:
resources:
limits:
cpus: '0.25'
memory: 256M
grafana:
image: grafana/grafana:latest
restart: unless-stopped
ports:
- '3002:3000'
environment:
GF_SECURITY_ADMIN_USER: ${GRAFANA_ADMIN_USER:-admin}
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:-admin}
GF_USERS_ALLOW_SIGN_UP: 'false'
GF_SERVER_ROOT_URL: ${STAGING_GRAFANA_URL:-http://localhost:3002}
volumes:
- grafana_staging_data:/var/lib/grafana
- ./infra/monitoring/grafana/provisioning:/etc/grafana/provisioning:ro
depends_on:
- prometheus
networks:
- brain-storm-staging
deploy:
resources:
limits:
cpus: '0.25'
memory: 256M
volumes:
postgres_staging_data:
driver: local
redis_staging_data:
driver: local
prometheus_staging_data:
driver: local
grafana_staging_data:
driver: local
networks:
brain-storm-staging:
name: brain-storm-staging
driver: bridge