-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
68 lines (66 loc) · 1.58 KB
/
Copy pathdocker-compose.yml
File metadata and controls
68 lines (66 loc) · 1.58 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
version: '3.9'
services:
frontend:
container_name: app_frontend
build: ./frontend
working_dir: /app-frontend
ports:
- 4200:4200
volumes:
- ./frontend/node_modules:/app-frontend/node_modules
- ./frontend/src:/app-frontend/src
depends_on:
backend:
condition: service_healthy
healthcheck:
test: ["CMD", "lsof", "-t", "-i:4200"]
timeout: 10s
retries: 5
backend:
build: ./backend
container_name: app_backend
working_dir: /app-backend
# restart: always
tty: true
stdin_open: true
volumes:
- ./backend/node_modules:/app-backend/node_modules
- ./backend/src:/app-backend/src
ports:
- 3001:3001
environment:
- DB_PASS=123456
- DB_USER=root
- DB_NAME=dashboard
- DB_HOST=db
- DB_PORT=3306
- PORT=3001
- JWT_SECRET=secret
depends_on:
db:
condition: service_healthy
networks:
- api_network
healthcheck:
test: ["CMD", "lsof", "-t", "-i:3001"] # Caso utilize outra porta interna para o back, altere ela aqui também
timeout: 10s
retries: 5
db:
image: mysql:8.0.21
container_name: container_db
restart: always
ports:
- 3306:3306
environment:
- MYSQL_ROOT_PASSWORD=123456
networks:
- api_network
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] # Deve aguardar o banco ficar operacional
timeout: 10s
retries: 5
cap_add:
- SYS_NICE # Deve omitir alertas menores
networks:
api_network:
driver: bridge