-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yml
51 lines (51 loc) · 1.02 KB
/
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
version: '3'
services:
api:
build: .
volumes:
- ./:/usr/src/app
command: php -S 0.0.0.0:3000 src/main.php
working_dir: /usr/src/app
ports:
- 3000:3000
user: daemon
environment:
DB_USER: user
DB_PASS: password
DB_HOST: db
DB_PORT: 3306
DB_NAME: test
depends_on:
- db
- migrations
migrations:
image: guilhermewebdev/migrator:slim
volumes:
- ./:/usr/src/app
working_dir: /usr/src/app
command: migrate latest
environment:
DB_USER: user
DB_PASS: password
DB_HOST: db
DB_PORT: 3306
DB_NAME: test
depends_on:
db:
condition: service_healthy
db:
image: mysql
volumes:
- db:/var/lib/mysql
restart: always
environment:
MYSQL_RANDOM_ROOT_PASSWORD: yes
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_DATABASE: test
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 10
volumes:
db: