forked from jpcaparas/laravel-horizon-demo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
107 lines (100 loc) · 1.96 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
version: "3.7"
services:
horizondb:
platform: linux/x86_64
image: mysql:8
restart: unless-stopped
tty: true
ports:
- 3306:3306
expose:
- 3306
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 10
environment:
MYSQL_DATABASE: horizon
MYSQL_USER: vapor
MYSQL_PASSWORD: vapor
MYSQL_ROOT_PASSWORD: horizon
MYSQL_TCP_PORT: 3306
volumes:
- mysqldata8:/var/lib/mysql/
migration:
depends_on:
horizondb:
condition: service_healthy
build:
context: .
dockerfile: Dockerfile
env_file:
- .env
command: |
/bin/sh -c "
set -e
php artisan migrate --seed
"
app:
depends_on:
migration:
condition: service_completed_successfully
restart: always
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
expose:
- "8000"
env_file:
- .env
command: |
/bin/sh -c "
set -e
php artisan serve --host 0.0.0.0
"
horizon:
depends_on:
migration:
condition: service_completed_successfully
restart: always
build:
context: .
dockerfile: Dockerfile
env_file:
- .env
command: |
/bin/sh -c "
set -e
php artisan horizon
"
dispatcher:
depends_on:
migration:
condition: service_completed_successfully
restart: always
build:
context: .
dockerfile: Dockerfile
env_file:
- .env
command: |
/bin/sh -c '
set -e
while sleep 5; do php artisan tinker --execute="\App\Jobs\ExampleJob::dispatch()"; done
'
redis:
image: redis:alpine
restart: always
environment:
- REDIS_PASSWORD=password
ports:
- "6379:6379"
expose:
- "6379"
volumes:
- redis_data:/data
volumes:
redis_data:
mysqldata8: