-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yaml
79 lines (77 loc) · 1.61 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
78
79
version: '3.9'
services:
frontend:
build:
dockerfile: ./apps/frontend-app/Dockerfile
target: development
context: .
command: npm run serve:frontend-app
ports:
- "3010:4200"
environment:
API_1_URL: api-1
API_2_URL: api-2
depends_on:
- api-1
- api-2
volumes:
- .:/app
- /app/node_modules
api-1:
build:
dockerfile: ./apps/api-1/Dockerfile
target: development
context: .
command: npm run serve:api-1
expose:
- 3333
ports:
- "4010:3333"
- "9010:9669"
depends_on:
- db
environment:
DATABASE_HOST: db
DATABASE_PORT: 5010
DATABASE_USER: api1
DATABASE_NAME: api1
DATABASE_PASSWORD: TopSecret123
volumes:
- .:/app
- /app/node_modules
api-2:
build:
dockerfile: ./apps/api-2/Dockerfile
target: development
context: .
command: npm run serve:api-2
expose:
- 3333
ports:
- "4020:3333"
- "9020:9669"
depends_on:
- db
environment:
DATABASE_HOST: db
DATABASE_PORT: 5010
DATABASE_USER: api2
DATABASE_NAME: api2
DATABASE_PASSWORD: TopSecret123
volumes:
- .:/app
- /app/node_modules
db:
image: postgres:15-alpine
ports:
- '5010:5432'
volumes:
- ./docker-postgres-multiple-dbs.sh:/docker-entrypoint-initdb.d/docker-postgres-multiple-dbs.sh
environment:
POSTGRES_USER: nxsuperuser
POSTGRES_PASSWORD: TopSecret123
POSTGRES_DB_NAMES: api1,api2
networks:
default:
name: example_dev_network
driver: bridge