-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
56 lines (52 loc) · 1.39 KB
/
Copy pathdocker-compose.yml
File metadata and controls
56 lines (52 loc) · 1.39 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
version: '3.8'
services:
# Banco de dados MySQL
mysql-db:
image: mysql:8.0
container_name: financefit-mysql
environment:
MYSQL_DATABASE: financefit
MYSQL_ROOT_PASSWORD: root123
MYSQL_USER: financefit
MYSQL_PASSWORD: financefit123
ports:
- "3307:3306" # Mapear para porta 3307 para evitar conflito
volumes:
- mysql_data:/var/lib/mysql
- ./docker/init.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- financefit-network
restart: unless-stopped
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
timeout: 20s
retries: 10
# Aplicação Spring Boot
financefit-api:
build:
context: .
dockerfile: Dockerfile
container_name: financefit-api
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://mysql-db:3306/financefit
SPRING_DATASOURCE_USERNAME: financefit
SPRING_DATASOURCE_PASSWORD: financefit123
SPRING_JPA_HIBERNATE_DDL_AUTO: update
JWT_SECRET: financefit_docker_secret_key_2025_muito_segura_complexa
JWT_EXPIRATION: 86400000
ports:
- "8080:8080"
depends_on:
mysql-db:
condition: service_healthy
networks:
- financefit-network
restart: unless-stopped
# Volumes para persistir dados
volumes:
mysql_data:
driver: local
# Rede personalizada
networks:
financefit-network:
driver: bridge