-
Notifications
You must be signed in to change notification settings - Fork 49
/
docker-compose.yml
65 lines (60 loc) · 1.21 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
version: "3"
services:
api:
build: packages/api
image: chat-api
container_name: chat-api
restart: unless-stopped
expose:
- "3000"
environment:
- DB_USERNAME
- DB_PASSWORD
- DB_HOST=db
- DB_NAME=$MONGO_INITDB_DATABASE
- SESS_SECRET
- REDIS_HOST=cache
- REDIS_PASSWORD
depends_on:
- db
- cache
web:
build: packages/web
image: chat-web
container_name: chat-web
expose:
- "80"
depends_on:
- api
db:
image: mongo
container_name: chat-db
user: $UID
expose:
- "27017"
environment:
- MONGO_INITDB_ROOT_USERNAME
- MONGO_INITDB_ROOT_PASSWORD
- MONGO_INITDB_DATABASE
- DB_USERNAME
- DB_PASSWORD
volumes:
- ./mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh
- ./data:/data/db
cache:
image: redis:alpine
container_name: chat-cache
expose:
- "6379"
environment:
- REDIS_PASSWORD
command: ['--requirepass "$REDIS_PASSWORD"']
proxy:
image: nginx:alpine
container_name: chat-proxy
volumes:
- ./proxy.conf:/etc/nginx/conf.d/default.conf
ports:
- 8080:80
depends_on:
- web