This repository has been archived by the owner on Apr 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
executable file
·126 lines (118 loc) · 3 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
version: "3.2"
services:
consul:
container_name: 'consul-container'
image: consul:1.3.0
command: consul agent -dev -client 0.0.0.0
ports:
- "8500:8500"
registrator:
container_name: 'registrator-container'
image: gliderlabs/registrator:v7
#Attach with Docker socket and will register all running containers
volumes:
- "/var/run/docker.sock:/tmp/docker.sock"
links:
- consul
command: -internal consul://consul:8500
redis:
container_name: redis_db-container
image: redis
ports:
- "6379:6379"
expose:
- "6379"
#tty: true
command: ["redis-server", "--appendonly", "yes"]
hostname: redis
#restart: always
rabbitmq-service:
container_name: 'rabbitmq-container'
image: "rabbitmq:3-management"
hostname: rabbit
environment:
RABBITMQ_ERLANG_COOKIE: "SWQOKODSQALRPCLNMEQG"
RABBITMQ_DEFAULT_USER: "guest"
RABBITMQ_DEFAULT_PASS: "guest"
RABBITMQ_DEFAULT_VHOST: "/"
ports:
- "15672:15672"
- "5672:5672"
labels:
NAME: "rabbitmq-server"
healthcheck:
test: ["CMD", "curl", "-f", "http://rabbitmq-service:15672"]
interval: 30s
timeout: 10s
retries: 5
labels:
name: "rabbit"
volumes:
- ../data:/var/lib/rabbitmq
- ../data/logs:/var/log/rabbitmq
restart: always
api-gateway:
container_name: "api-gateway"
build:
context: './api-gateway/'
dockerfile: Dockerfile
tty: true
ports:
- "8080:7000"
labels:
name: "API gateway"
links:
- rabbitmq-service
# Mount app src code and node_modules to the container.
# To be deleted in case for AWS/GCP/Azure cloud platforms.
volumes:
- ./api-gateway:/usr/src/api-gateway:rw
- /usr/src/api-gateway/node_modules
restart: always
customer-service:
container_name: 'customer-service'
build:
context: './customer_service/'
dockerfile: Dockerfile
tty: true
labels:
name: "Customer Service"
links:
- api-gateway
- redis
volumes:
- ./customer_service:/usr/src/customer_service:rw
- /usr/src/customer_service/node_modules
restart: always
vehicle-service:
container_name: 'vehicle-service'
build:
context: './vehicle_service/'
dockerfile: Dockerfile
tty: true
labels:
name: "Vehicle Service"
links:
- api-gateway
volumes:
- ./vehicle_service:/usr/src/vehicle_service:rw
- /usr/src/vehicle_service/node_modules
restart: always
## Fronetend Application
frontend-app:
container_name: 'frontend-app'
build:
context: './frontend'
dockerfile: Dockerfile
tty: true
labels:
name: 'Frontend Angular Application'
links:
- api-gateway
ports:
- "3004:4200"
volumes:
- ./frontend:/usr/src/frontend
- ./frontend/nginx-files/nginx.conf:/etc/nginx/nginx.conf
- /usr/src/frontend/node_modules
restart: always