-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yml
45 lines (44 loc) · 1.04 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
version: '3'
services:
web:
build:
context: ./web
dockerfile: Dockerfile
ports:
- "3005:3005"
restart: always
server:
build:
context: ./server
dockerfile: Dockerfile
ports:
- "8000:8000"
environment:
- MONGODB_URI=mongodb://db:27017/knowzone?replicaSet=rs0
- REACT_URL=http://localhost:3005
- SESSION_SECRET=knowzone-auth-secret
- SESSION_NAME=sid
- SESSION_LIFETIME=2592000000
- SESSION_SECURE=false
- PUBLIC_UPLOAD_PATH=/opt/node_app/uploads
- IMAGE_UPLOAD_SUBPATH=images
volumes:
- uploads:/opt/node_app/uploads
depends_on:
- db
restart: always
db:
image: mongo
restart: always
volumes:
- mongo_data:/data/db
ports:
- "27017:27017"
command: mongod --replSet rs0 --bind_ip_all
healthcheck:
test: >
mongosh --eval "try { rs.initiate({ _id: 'rs0', members: [{ _id: 0, host: 'db:27017' }] }) } catch(e) { rs.status().ok }"
interval: 3s
volumes:
uploads:
mongo_data: