-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
37 lines (36 loc) · 1.1 KB
/
docker-compose.yml
File metadata and controls
37 lines (36 loc) · 1.1 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
services:
mysql:
image: mysql:8.0 # Versão correta para MySQL
container_name: mysql_taskmaster
restart: always
environment:
MYSQL_DATABASE: ${DB_NAME}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
ports:
- "3306:3306" # Porta correta do MySQL
volumes:
- ./data_taskmaster:/var/lib/mysql
- ./init_scripts:/docker-entrypoint-initdb.d # Mapeando a pasta de scripts
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h localhost -u$${DB_USER} -p$${DB_PASSWORD}"]
interval: 10s
timeout: 5s
retries: 10
start_period: 20s
api:
build: .
container_name: taskmaster_api
restart: always
environment:
SPRING_PROFILES_ACTIVE: mysql
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/${DB_NAME}?createDatabaseIfNotExist=true&useSSL=false
SPRING_DATASOURCE_USERNAME: ${DB_USER}
SPRING_DATASOURCE_PASSWORD: ${DB_PASSWORD}
JWT_SECRET: ${JWT_SECRET}
ports:
- "8081:8081"
depends_on:
mysql:
condition: service_healthy