-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.prod.yml
138 lines (130 loc) · 3.59 KB
/
docker-compose.prod.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
127
128
129
130
131
132
133
134
135
136
137
138
version: "3.8"
services:
database:
image: mysql:8.0.20
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: VTdb
MYSQL_USER: root
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
volumes:
- db_file:/var/lib/mysql
restart: always
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
interval: 1s
timeout: 5s
retries: 20
networks:
- backend
rabbitmq:
image: rabbitmq:3-management-alpine
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 20s
timeout: 10s
retries: 20
depends_on:
database :
condition: service_healthy
environment:
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
ports:
- 5672:5672
- 15672:15672
networks:
- backend
app:
depends_on:
database :
condition: service_healthy
build: ./projVineTracker/backend/vineTrack
restart: on-failure
ports:
- 8080:8080
environment:
SPRING_APPLICATION_JSON: '{
"spring.datasource.url" : "jdbc:mysql://database:3306/VTdb?allowPublicKeyRetrieval=true&useSSL=false",
"spring.datasource.username" : "root",
"spring.datasource.password" : "${MYSQL_PASSWORD}",
"spring.jpa.properties.hibernate.dialect" : "org.hibernate.dialect.MySQLDialect",
"spring.jpa.hibernate.ddl-auto" : "update",
"springdoc.swagger-ui.path" : "/swagger-ui-custom.html",
"springdoc.api-docs.path" : "/api-docs",
"springdoc.version" : "@springdoc.version@",
"api.version" : "1.0-SNAPSHOT",
"tos.uri" : "terms-of-service",
"api.server.url" : "http://localhost:8080/",
"api.description" : "Monitoring your Vines.",
"springdoc.swagger-ui.operationsSorter" : "alpha",
"springdoc.swagger-ui.tagsSorter" : "alpha",
"api.title" : "VineTrack REST API",
"management.endpoints.web.exposure.include" : "health",
"spring.rabbitmq.host" : "rabbitmq",
"spring.rabbitmq.port" : "5672",
"spring.rabbitmq.username" : "guest",
"spring.rabbitmq.password" : "${RABBITMQ_DEFAULT_PASS}"
}'
stdin_open: true
tty: true
volumes:
- ./projVineTracker/backend/vineTrack:/vineTrack
- backendData:/root/.m2
healthcheck:
test: wget --no-verbose --tries=1 --spider localhost:8080/actuator/health || exit 1
interval: 2s
timeout: 30s
retries: 200
start_period: 10s
networks:
- backend
- frontend
client:
depends_on:
app:
condition: service_healthy
build:
context: ./projVineTracker/frontend
dockerfile: Dockerfile.prod
environment:
- VITE_APP_SERVER_URL=http://deti-ies-04.ua.pt
ports:
- 3030:3030
volumes:
- ./projVineTracker/frontend:/app
- modules:/app/node_modules
networks:
- frontend
generator:
build: ./projVineTracker/dataGenerator
restart: on-failure
depends_on:
database:
condition: service_healthy
rabbitmq:
condition: service_healthy
networks:
- backend
proxy:
image: nginx:1.25.3
ports:
- 80:80
depends_on:
client:
condition: service_started
app:
condition: service_healthy
networks:
- backend
- frontend
restart: unless-stopped
volumes:
- ./projVineTracker/proxy/default.conf:/etc/nginx/conf.d/default.conf
volumes:
db_file:
backendData:
modules:
networks:
backend:
frontend: