-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
86 lines (80 loc) · 1.85 KB
/
docker-compose.yml
File metadata and controls
86 lines (80 loc) · 1.85 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
version: '3.8'
services:
api:
build:
context: .
target: build
ports:
- "3000:3000"
volumes:
- ./src:/app/src
- ./test:/app/test
depends_on:
- mysql
- mongodb
- redis
- nats
environment:
- NODE_ENV=development
- DB_HOST=mysql
- DB_USERNAME=${DB_USERNAME:-root}
- DB_PASSWORD=${DB_PASSWORD:-password}
- DB_NAME=${DB_NAME:-social_media}
- MG_HOST=mongodb
- MG_DBNAME=${MG_DBNAME:-social_media_notifications}
- REDIS_HOST=redis
- REDIS_PORT=6379
- NATS_URL=nats://nats:4222
- ADMIN_USER=${ADMIN_USER:-admin}
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-password}
command: pnpm run start:dev
mysql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:-password}
MYSQL_DATABASE: ${DB_NAME:-social_media}
ports:
- "3307:3306"
volumes:
- mysql-data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_PASSWORD:-password}"]
interval: 10s
timeout: 5s
retries: 5
mongodb:
image: mongo:6.0
ports:
- "27017:27017"
volumes:
- mongodb-data:/data/db
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7.0-alpine
ports:
- "6379:6379"
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
nats:
image: nats:2.9-alpine
ports:
- "4222:4222"
- "8222:8222"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8222/varz"]
interval: 10s
timeout: 5s
retries: 5
volumes:
mysql-data:
mongodb-data:
redis-data: