-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
109 lines (96 loc) · 2.4 KB
/
docker-compose.yml
File metadata and controls
109 lines (96 loc) · 2.4 KB
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
version: "3.8"
services:
mysql:
image: mysql:8.0
container_name: qreports-mysql
environment:
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_password
MYSQL_DATABASE: qreports_auth
MYSQL_ROOT_HOST: "%"
secrets:
- db_password
ports:
- "3307:3306"
volumes:
- mysql-data:/var/lib/mysql
- ./docker/mysql/init.sh:/docker-entrypoint-initdb.d/init.sh
networks:
- qreports-network
healthcheck:
# Garante MySQL pronto
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost", "-p${MYSQL_ROOT_PASSWORD}" ]
interval: 5s
timeout: 3s
retries: 10
redis:
image: redis:alpine
container_name: qreports-redis
ports:
- "6379:6379"
networks:
- qreports-network
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 5s
timeout: 3s
retries: 5
backend:
build: ./backend
container_name: qreports-backend
ports:
- "3000:3000"
environment:
AUTH_DB_HOST: mysql
AUTH_DB_PORT: 3306
AUTH_DB_USER: root
AUTH_DB_NAME: qreports_auth
AUTH_DB_PASSWORD_FILE: /run/secrets/db_password
REPORT_DB_READ_USER: ${REPORT_DB_READ_USER}
REPORT_DB_READ_PASSWORD_FILE: /run/secrets/report_db_read_password
REPORT_DB_WRITE_USER: ${REPORT_DB_WRITE_USER}
REPORT_DB_WRITE_PASSWORD_FILE: /run/secrets/report_db_write_password
JWT_SECRET_FILE: /run/secrets/jwt_secret
JWT_EXPIRES_IN: 8h
secrets:
- db_password
- report_db_read_password
- report_db_write_password
- jwt_secret
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./backend:/app
- /app/node_modules
- ./shared:/shared
networks:
- qreports-network
frontend:
build: ./frontend
container_name: qreports-frontend
ports:
- "5173:5173"
volumes:
- ./frontend:/app
- /app/node_modules
- ./shared:/shared
depends_on:
- backend
networks:
- qreports-network
volumes:
mysql-data:
networks:
qreports-network:
driver: bridge
secrets:
db_password:
file: ./.secrets/db_password.txt
report_db_read_password:
file: ./.secrets/report_db_read_password.txt
report_db_write_password:
file: ./.secrets/report_db_write_password.txt
jwt_secret:
file: ./.secrets/jwt_secret.txt