-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose.yml
71 lines (66 loc) · 1.42 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
version: '3.8'
networks:
boilerplate:
volumes:
mongo_volume:
driver: local
driver_opts:
type: none
o: bind
device: /var/lib/mongo/data/db
postgres_volume:
driver: local
driver_opts:
type: none
o: bind
device: /var/lib/postgres
services:
mongo:
container_name: mongo
image: mongo:latest
ports:
- "27017:27017"
networks:
- boilerplate
volumes:
- mongo_volume:/data/db
restart: unless-stopped
postgres:
container_name: postgres
image: postgres:latest
environment:
- POSTGRES_DB=dummy
- POSTGRES_USER=root
- POSTGRES_PASSWORD=root
ports:
- "5432:5432"
networks:
- boilerplate
volumes:
- postgres_volume:/var/lib/postgres
- ${PWD}/hack/fixtures/db-init.sql:/docker-entrypoint-initdb.d/db-init.sql
restart: unless-stopped
api:
build: .
hostname: api.boilerplate
container_name: api
command:
- /bin/bash
- -c
- |
./hack/wait_for_it.sh --timeout=30 --host=mongo --port=27017 --strict -- \
./hack/wait_for_it.sh --timeout=30 --host=postgres --port=5432 --strict -- \
yarn start;
depends_on:
- mongo
- postgres
environment:
- LOG_LEVEL=debug
- MONGO_URI=mongo
- POSTGRES_URL=postgres
ports:
- "3001:3001"
- "8443:8443"
networks:
- boilerplate
restart: unless-stopped