-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
58 lines (56 loc) · 1.87 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
version: "3.8"
services:
multiverse_travels_booker:
container_name: multiverse_travels_booker
image: api_multiverse_travels_booker
build:
context: .
target: prod
working_dir: /usr/src/api
restart: always
environment:
- APP_ENV=production # Variável para mudar ambiente do "jennifer ORM"
- KEMAL_ENV=production # Variável para mudar ambiente do "Kemal"
- API_PORT=3000 # Variável para mudar porta da API
- API_HOST=0.0.0.0 # Variável mudar host da API
- API_SWAGGER_PORT=3000 # Variável mudar porta da API Swagger
- API_SWAGGER_HOST=localhost # Variável mudar host da API Swagger
ports:
- 3000:3000
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
depends_on:
db_multiverse_travels_booker:
condition: service_healthy # Deve aguardar o banco ficar operacional
networks:
- multiverse_travels_booker
db_multiverse_travels_booker:
container_name: db_multiverse_travels_booker
image: mysql_init_db
build:
context: ./db
target: db_prod
command: mysqld --default-authentication-plugin=mysql_native_password # Comando necessário para que o "jennifer ORM" conecte-se ao banco dados
restart: "always"
environment:
- MYSQL_ROOT_PASSWORD=root123456
ports:
- 3003:3306
platform: linux/x86_64
cap_add:
- SYS_NICE # Deve omitir alertas menores
volumes:
- ./db/structure.sql:/usr/src/database/structure.sql
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"] # Deve aguardar o banco ficar operacional
timeout: 10s
retries: 5
networks:
- multiverse_travels_booker
networks:
multiverse_travels_booker:
external: false
name: multiverse_travels_booker