-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
48 lines (46 loc) · 1.22 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
version: '3'
services:
node:
image: node:20-alpine3.17
container_name: pagar_bem
tty: true
stdin_open: true
restart: always
command: sh -c "npm install && npm run docker && npm run dev"
working_dir: /app
volumes:
- ./:/app
- ./package.json:/app/package.json
- ./package-lock.json:/app/package-lock.json
depends_on:
db:
condition: service_healthy
ports:
- 3001:3001
environment:
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_HOST=${MYSQL_HOST}
- JWT_SECRET=${JWT_SECRET}
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:
container_name: pagar_bem_db
image: mysql:8.0.21
platform: linux/x86_64
restart: always
ports:
- 3306:3306
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
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:
default:
name: pagar_bem_net