-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
49 lines (45 loc) · 953 Bytes
/
docker-compose.yml
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
networks:
app_network:
driver: bridge
services:
# Backend Service
app:
build: .
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
ports:
- "${PORT}:${PORT}"
environment:
- PORT=${PORT}
- JWT_SECRET=${JWT_SECRET}
- NATS_URL=${NATS_URL}
- MONGO_URI=${MONGO_URI}
depends_on:
- nats
- mongo
networks:
- app_network
# NATS Service with WebSocket and JetStream
nats:
image: nats
ports:
- "${NATS_PORT}:4222" # NATS client port
- "${NATS_WS_PORT}:8080" # WebSocket port for NATS WebSocket connections
volumes:
- ./nats.conf:/etc/nats/nats.conf
command: -c /etc/nats/nats.conf
networks:
- app_network
# MongoDB Service
mongo:
image: mongo
ports:
- "${MONGO_PORT}:27017"
volumes:
- mongo_data:/data/db
networks:
- app_network
volumes:
mongo_data:
driver: local