-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
64 lines (60 loc) · 1.42 KB
/
docker-compose.yml
File metadata and controls
64 lines (60 loc) · 1.42 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
version: '3.8'
services:
# Banco de dados MySQL
mysql:
image: mysql:8.0
container_name: guiaifpe-mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: root123
MYSQL_DATABASE: guia_ifpe
MYSQL_USER: guiaifpe
MYSQL_PASSWORD: guiaifpe123
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
- ./scripts/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
timeout: 20s
retries: 10
# Backend Node.js
backend:
build: ./backend
container_name: guiaifpe-backend
restart: unless-stopped
ports:
- "3001:3001"
environment:
DB_HOST: mysql
DB_USER: guiaifpe
DB_PASSWORD: guiaifpe123
DB_NAME: guia_ifpe
DB_PORT: 3306
JWT_SECRET: sua_chave_jwt_super_secreta_aqui
PORT: 3001
NODE_ENV: development
depends_on:
mysql:
condition: service_healthy
volumes:
- ./backend:/app
- /app/node_modules
# Frontend React (desenvolvimento)
frontend:
image: node:18-alpine
container_name: guiaifpe-frontend
working_dir: /app
ports:
- "5173:5173"
environment:
VITE_API_URL: http://localhost:3001
volumes:
- .:/app
- /app/node_modules
command: sh -c "npm install && npm run dev -- --host 0.0.0.0"
depends_on:
- backend
volumes:
mysql_data: