-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
81 lines (63 loc) · 1.53 KB
/
docker-compose.yml
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
version: "3"
services:
backend:
build: ./back-end
container_name: backend
tty: true
stdin_open: true
restart: always
working_dir: /app
volumes:
- ./back-end:/app
depends_on:
db:
condition: service_healthy
ports:
- 3001:3001
environment:
PORT: 3001
MYSQL_USER: root
MYSQL_PASSWORD: password
MYSQL_PORT: 3306
HOSTNAME: db
MYSQL_DB_NAME: delivery-app
EVAL_ALWAYS_RESTORE_DEV_DB: true
NODE_ENV: development
healthcheck:
test: ["CMD", "lsof", "-t", "-i:3001"] # Caso utilize outra porta interna para o back, altere ela aqui também
timeout: 10s
retries: 5
frontend:
build: ./front-end
container_name: frontend
tty: true
stdin_open: true
restart: always
working_dir: /app
volumes:
- ./front-end:/app
depends_on:
backend:
condition: service_healthy
ports:
- 3000:3000
healthcheck:
test: ["CMD", "lsof", "-t", "-i:3000"] # Caso utilize outra porta interna para o front, altere ela aqui também
timeout: 10s
retries: 5
environment:
API_PORT: 3001
API_HOST: backend
db:
container_name: app_delivery_db
image: mysql:8.0.21
restart: always
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] # Deve aguardar o banco ficar operacional
timeout: 10s
retries: 5
ports:
- 3306:3306
- 33060:33060
environment:
MYSQL_ROOT_PASSWORD: password