-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
88 lines (81 loc) · 1.83 KB
/
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
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
version: '3.8'
services:
# FastAPI Service
fastapi:
container_name: fastapi_server
build:
context: ./Chat-Service/server
dockerfile: Dockerfile
environment:
- SECRET_KEY_FILE=/run/secrets/secret_key
- MONGO_USER_FILE=/run/secrets/mongo_user
- MONGO_PASSWORD_FILE=/run/secrets/mongo_password
- MONGO_HOST=mongo
- MONGO_PORT=27017
- MONGO_DB=chat_service
secrets:
- secret_key
- mongo_user
- mongo_password
volumes:
- ./Chat-Service/server:/app
depends_on:
- mongo
# Node.js Service
nodejs:
container_name: nodejs_server
build:
context: ./Chat-Service/client
dockerfile: Dockerfile.client
environment:
- REACT_APP_API_URL=http://127.0.0.1:8000
volumes:
- ./Chat-Service/client:/usr/src/app
depends_on:
- fastapi
# MongoDB Service
mongo:
image: mongo:7.0
container_name: mongo_db
environment:
MONGO_INITDB_ROOT_USERNAME_FILE: /run/secrets/mongo_user
MONGO_INITDB_ROOT_PASSWORD_FILE: /run/secrets/mongo_password
MONGO_INITDB_DATABASE: chat_service
ports:
- "27017:27017"
volumes:
- mongo-data:/data/db
secrets:
- mongo_user
- mongo_password
# Nginx Service
nginx:
build:
context: ./Chat-Service/nginx
dockerfile: Dockerfile.nginx
container_name: nginx_proxy
ports:
- "80:80"
depends_on:
- fastapi
- nodejs
# Nginx Service
nginx:
build:
context: ./Chat-Service/nginx
dockerfile: Dockerfile.nginx
container_name: nginx_proxy
ports:
- "80:80"
depends_on:
- fastapi
- nodejs
secrets:
mongo_password:
file: ./secrets/mongo_password
mongo_user:
file: ./secrets/mongo_user
secret_key:
file: ./secrets/secret_key
volumes:
mongo-data: