forked from mjhea0/microservice-movies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
104 lines (97 loc) · 2.67 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
version: '2.1'
services:
users-db:
container_name: users-db
build: ./services/users/src/db
ports:
- '5433:5432' # expose ports - HOST:CONTAINER
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
healthcheck:
test: exit 0
movies-db:
container_name: movies-db
build: ./services/movies/src/db
ports:
- '5434:5432' # expose ports - HOST:CONTAINER
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
healthcheck:
test: exit 0
users-service:
container_name: users-service
build: ./services/users/
volumes:
- './services/users:/usr/src/app'
- './services/users/package.json:/usr/src/package.json'
ports:
- '3000:3000' # expose ports - HOST:CONTAINER
environment:
- DATABASE_URL=postgres://postgres:postgres@users-db:5432/users_dev
- DATABASE_TEST_URL=postgres://postgres:postgres@users-db:5432/users_test
- NODE_ENV=${NODE_ENV}
- TOKEN_SECRET=changeme
depends_on:
users-db:
condition: service_healthy
links:
- users-db
movies-service:
container_name: movies-service
build: ./services/movies/
volumes:
- './services/movies:/usr/src/app'
- './services/movies/package.json:/usr/src/package.json'
ports:
- '3001:3000' # expose ports - HOST:CONTAINER
environment:
- DATABASE_URL=postgres://postgres:postgres@movies-db:5432/movies_dev
- DATABASE_TEST_URL=postgres://postgres:postgres@movies-db:5432/movies_test
- NODE_ENV=${NODE_ENV}
- TOKEN_SECRET=changeme
depends_on:
movies-db:
condition: service_healthy
users-service:
condition: service_started
links:
- movies-db
- users-service
web-service:
container_name: web-service
build: ./services/web/
volumes:
- './services/web:/usr/src/app'
- '/usr/src/app/node_modules'
ports:
- '3007:3006' # expose ports - HOST:CONTAINER
environment:
- NODE_ENV=${NODE_ENV}
depends_on:
users-service:
condition: service_started
movies-service:
condition: service_started
links:
- users-service
- movies-service
swagger:
container_name: swagger
build: ./services/movies/swagger/
volumes:
- './services/movies/swagger:/usr/src/app'
- '/usr/src/app/node_modules'
ports:
- '3003:3001' # expose ports - HOST:CONTAINER
environment:
- NODE_ENV=${NODE_ENV}
depends_on:
users-service:
condition: service_started
movies-service:
condition: service_started
links:
- users-service
- movies-service