forked from StarkMindsHQ/StrellerMinds-Backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
218 lines (207 loc) · 5.64 KB
/
docker-compose.dev.yml
File metadata and controls
218 lines (207 loc) · 5.64 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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
version: '3.8'
services:
# Main Application
app:
build:
context: .
dockerfile: Dockerfile
target: development
container_name: strellerminds-backend-dev
ports:
- "3000:3000"
environment:
- NODE_ENV=development
- PORT=3000
- DATABASE_HOST=postgres
- DATABASE_PORT=5432
- DATABASE_USER=strellerminds
- DATABASE_PASSWORD=strellerminds_dev_password
- DATABASE_NAME=strellerminds_dev
- REDIS_HOST=redis
- REDIS_PORT=6379
- JWT_SECRET=dev_jwt_secret_key_change_in_production
- JWT_REFRESH_SECRET=dev_refresh_secret_key_change_in_production
- ELASTICSEARCH_URL=http://elasticsearch:9200
- SENTRY_DSN=${SENTRY_DSN:-}
volumes:
- .:/app
- /app/node_modules
- /app/dist
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
elasticsearch:
condition: service_healthy
networks:
- strellerminds-network
restart: unless-stopped
command: npm run start:dev
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: strellerminds-postgres-dev
environment:
- POSTGRES_DB=strellerminds_dev
- POSTGRES_USER=strellerminds
- POSTGRES_PASSWORD=strellerminds_dev_password
- POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
ports:
- "5432:5432"
volumes:
- postgres_data_dev:/var/lib/postgresql/data
- ./scripts/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
networks:
- strellerminds-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U strellerminds -d strellerminds_dev"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
# Redis Cache
redis:
image: redis:7-alpine
container_name: strellerminds-redis-dev
ports:
- "6379:6379"
volumes:
- redis_data_dev:/data
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf
networks:
- strellerminds-network
restart: unless-stopped
command: redis-server /usr/local/etc/redis/redis.conf
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
# Elasticsearch for Search
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
container_name: strellerminds-elasticsearch-dev
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- xpack.security.enrollment.enabled=false
ports:
- "9200:9200"
- "9300:9300"
volumes:
- elasticsearch_data_dev:/usr/share/elasticsearch/data
networks:
- strellerminds-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:9200/_cluster/health || exit 1"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
# Kibana for Elasticsearch Management
kibana:
image: docker.elastic.co/kibana/kibana:8.11.0
container_name: strellerminds-kibana-dev
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
- XPACK_SECURITY_ENABLED=false
ports:
- "5601:5601"
depends_on:
elasticsearch:
condition: service_healthy
networks:
- strellerminds-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:5601/api/status || exit 1"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
# Redis Commander for Redis Management
redis-commander:
image: rediscommander/redis-commander:latest
container_name: strellerminds-redis-commander-dev
environment:
- REDIS_HOSTS=local:redis:6379
ports:
- "8081:8081"
depends_on:
redis:
condition: service_healthy
networks:
- strellerminds-network
restart: unless-stopped
# pgAdmin for PostgreSQL Management
pgadmin:
image: dpage/pgadmin4:latest
container_name: strellerminds-pgadmin-dev
environment:
- PGADMIN_DEFAULT_PASSWORD=admin123
- PGADMIN_CONFIG_SERVER_MODE=False
ports:
- "8080:80"
volumes:
- pgadmin_data_dev:/var/lib/pgadmin
- ./scripts/pgadmin-servers.json:/pgadmin4/servers.json
depends_on:
postgres:
condition: service_healthy
networks:
- strellerminds-network
restart: unless-stopped
# MailHog for Email Testing
mailhog:
image: mailhog/mailhog:latest
container_name: strellerminds-mailhog-dev
ports:
- "1025:1025" # SMTP port
- "8025:8025" # Web UI port
networks:
- strellerminds-network
restart: unless-stopped
# MinIO for S3-compatible Storage Testing
minio:
image: minio/minio:latest
container_name: strellerminds-minio-dev
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin123
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio_data_dev:/data
networks:
- strellerminds-network
restart: unless-stopped
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
volumes:
postgres_data_dev:
driver: local
redis_data_dev:
driver: local
elasticsearch_data_dev:
driver: local
pgadmin_data_dev:
driver: local
minio_data_dev:
driver: local
networks:
strellerminds-network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16