-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
77 lines (72 loc) · 1.62 KB
/
docker-compose.yaml
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
# Use only for development
version: "2.4"
services:
# The express backend service
backend:
build:
context: ./
target: dev
environment:
- TZ
- MONGO_CONNECTION
- JWT_PRIVATE_KEY
- JWT_REFRESH_PRIVATE_KEY
- JWT_ISSUER
- RESET_PASSWORD_URL=localhost:8080/reset-password
- SMTP_HOST
- SMTP_PORT
- SMTP_USERNAME
- SMTP_PASSWORD
- FROM_EMAIL
- FROM_NAME
volumes:
- .:/app
ports:
- 3000:3000
- 9229:9229
depends_on:
db:
condition: service_healthy
# The local mongodb service
db:
image: mongo:5
environment:
- TZ
- MONGO_DATABASE_NAME
volumes:
- dbdata:/data/db
ports:
- 27017:27017
healthcheck:
test: '[ `echo ''db.runCommand("ping").ok'' | mongo localhost/${MONGO_DATABASE_NAME} --quiet` ] && echo 0 || echo 1'
interval: 5s
start_period: 10s
timeout: 4s
retries: 3
# Db admin web interface
dbAdmin:
image: mongo-express
environment:
- ME_CONFIG_MONGODB_SERVER=db
- ME_CONFIG_BASICAUTH_USERNAME=root
- ME_CONFIG_BASICAUTH_PASSWORD=admin
ports:
- 8081:8081
depends_on:
db:
condition: service_started
# Takes js file in the seeds folder for creating the initial state of the app
seeder:
image: pkosiec/mongo-seeding:latest
volumes:
- ./seeds:/data:ro
environment:
- DB_URI=${MONGO_CONNECTION}
- DROP_DATABASE=false
- DROP_COLLECTIONS=true
depends_on:
db:
condition: service_healthy
volumes:
# Mongo db named volume
dbdata: