-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
108 lines (94 loc) · 1.98 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
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
version: '3.8'
services:
# Spring Boot API
api:
build:
context: SmartHome_API
dockerfile: Dockerfile
ports:
- "8080:8080"
restart: unless-stopped
environment: # Pass environment variables to the service
SPRING_DATASOURCE_URL: jdbc:mysql://db:3306/SmartHome?allowPublicKeyRetrieval=true&useSSL=false
SPRING_DATASOURCE_USERNAME: springuser
SPRING_DATASOURCE_PASSWORD: password
depends_on:
- db
# - data_generators
networks:
- backend
# FrontEnd
frontend:
build:
context: SmartHome
dockerfile: Dockerfile
ports:
- "3000:3000"
restart: unless-stopped
depends_on:
- api
- db
networks:
- frontend
# Database
db:
image: mysql
ports:
- "3307:3306"
restart: always
environment:
MYSQL_DATABASE: SmartHome
MYSQL_USER: springuser
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: root
volumes:
- ./database:/docker-entrypoint-initdb.d/:ro
networks:
- backend
- data_gen
# Message Queue
rmq:
image: rabbitmq:3.11.5-alpine
volumes:
- ./.docker/rabbitmq/etc/:/etc/rabbitmq/
- ./.docker/rabbitmq/data/:/var/lib/rabbitmq/mnesia
- ./.docker/rabbitmq/logs/:/var/log/rabbitmq/mnesia
ports:
- 5672:5672
- 15672:15672
- 15674:15674
environment:
- RABBITMQ_DEFAULT_PASS=test
- RABBITMQ_DEFAULT_USER=test
- RABBITMQ_DEFAULT_VHOST=/
networks:
- backend
# Geração de dados
data_generators:
build:
context: generators
dockerfile: Dockerfile
restart: always
depends_on:
- rmq
- db
networks:
- backend
- data_gen
# Servidor Python
server:
build:
context: backend
dockerfile: Dockerfile
restart: always
ports:
- 8765:8765
depends_on:
- db
networks:
- frontend
- data_gen
networks:
backend:
frontend:
data_gen: