-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
56 lines (53 loc) · 1.14 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
version: "3.8"
services:
api:
build:
context: .
target: builder
image: mohllal/air-quality-service
env_file: .env.dev
environment:
MONGODB_URL: "mongodb://db:27017/airquality"
container_name: api
restart: always
ports:
- 3000:3000
volumes:
- ./:/app
- /app/node_modules
command: npm run api:dev
depends_on:
db:
condition: service_healthy
cron:
build:
context: .
target: builder
image: mohllal/air-quality-service
env_file: .env.dev
container_name: cron
restart: always
volumes:
- ./:/app
- /app/node_modules
command: npm run cron:dev
depends_on:
db:
condition: service_healthy
db:
image: mongo:6.0
environment:
MONGO_INITDB_DATABASE: airquality
container_name: db
restart: always
ports:
- 27017:27017
volumes:
- ./docker/db/data:/data/db
- ./docker/db/logs:/var/log/mongodb
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 20s
timeout: 10s
retries: 5
start_period: 5s