-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
49 lines (49 loc) · 1.13 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
version: '3'
services:
multi-tenant-app:
image: node
working_dir: /usr/src/app
volumes:
- ./:/usr/src/app
command: bash -c "npm install && npm start"
ports:
- "3002:8080"
depends_on:
- common-db
- tenant-1-db
- tenant-2-db
env_file:
- .env
common-db:
container_name: common_db
image: postgres
environment:
POSTGRES_USER: common_db
POSTGRES_PASSWORD: common_db
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "5432:5432"
restart: unless-stopped
tenant-1-db:
container_name: tenant_1_db
image: postgres
environment:
POSTGRES_USER: tenant_1_db
POSTGRES_PASSWORD: tenant_1_db
volumes:
- ./tenant_1_data.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "5433:5432"
restart: unless-stopped
tenant-2-db:
container_name: tenant_2_db
image: postgres
environment:
POSTGRES_USER: tenant_2_db
POSTGRES_PASSWORD: tenant_2_db
volumes:
- ./tenant_2_data.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "5434:5432"
restart: unless-stopped