-
Notifications
You must be signed in to change notification settings - Fork 21
/
docker-compose.yml
149 lines (148 loc) · 3.58 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
services:
mongo:
container_name: js-vacancy-test-task-mongo
image: mongo:6.0
entrypoint:
- bash
- -c
- |
exec docker-entrypoint.sh $$@
command: mongod --replSet rs --bind_ip_all --keyFile config/keyfile --quiet --logpath /dev/null
environment:
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_ROOT_PASSWORD=root
networks:
- js-vacancy-test-task
ports:
- 27017:27017
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- .dev/mongo/config/keyfile:/config/keyfile
- type: volume
source: mongodb
target: /data/db
- type: volume
source: mongodb-cfg
target: /data/configdb
# mongo-replicator creates a replica set for transaction support
mongo-replicator:
container_name: js-vacancy-test-task-mongo-replicator
image: mongo:6.0
entrypoint:
- bash
- -c
- |
cd /scripts
chmod +x /setup.sh
bash /setup.sh
volumes:
- ./bin/setup.sh:/setup.sh
- ./bin:/scripts
environment:
- HOST=mongo
- PORT=27017
- USERNAME=root
- PASSWORD=root
- REPLICA_SET_NAME=rs
networks:
- js-vacancy-test-task
depends_on:
- mongo
redis:
container_name: js-vacancy-test-task-redis
image: redis:5.0.5
command: redis-server --appendonly yes
hostname: redis
networks:
- js-vacancy-test-task
ports:
- 6379:6379
api:
container_name: js-vacancy-test-task-api
build:
context: .
dockerfile: ./apps/api/Dockerfile
target: development
args:
NODE_ENV: development
APP_ENV: development
networks:
- js-vacancy-test-task
volumes:
- ./apps/api/src:/app/apps/api/src
- mailer-volume:/app/packages/mailer
ports:
- 3001:3001
depends_on:
- redis
- mongo-replicator
migrator:
container_name: js-vacancy-test-task-migrator
build:
context: .
dockerfile: ./apps/api/Dockerfile.migrator
target: development
args:
NODE_ENV: development
APP_ENV: development
networks:
- js-vacancy-test-task
volumes:
- ./apps/api/src:/app/apps/api/src
depends_on:
- mongo-replicator
scheduler:
container_name: js-vacancy-test-task-scheduler
build:
context: .
dockerfile: ./apps/api/Dockerfile.scheduler
target: development
args:
NODE_ENV: development
APP_ENV: development
networks:
- js-vacancy-test-task
volumes:
- ./apps/api/src:/app/apps/api/src
depends_on:
- mongo-replicator
web:
container_name: js-vacancy-test-task-web
build:
context: .
dockerfile: ./apps/web/Dockerfile
target: development
args:
NODE_ENV: development
APP_ENV: development
volumes:
- ./apps/web/src:/app/apps/web/src
- ./apps/web/public:/app/apps/web/public
networks:
- js-vacancy-test-task
ports:
- 3002:3002
mailer:
container_name: js-vacancy-test-task-mailer
build:
context: .
dockerfile: ./packages/mailer/Dockerfile
target: development
args:
NODE_ENV: development
APP_ENV: development
volumes:
- mailer-volume:/app/packages/mailer/dist
- ./packages/mailer/emails:/app/packages/mailer/emails
- ./packages/mailer/src:/app/packages/mailer/src
networks:
- js-vacancy-test-task
ports:
- 3003:3003
networks:
js-vacancy-test-task:
name: js-vacancy-test-task-network
volumes:
mongodb:
mongodb-cfg:
mailer-volume: