-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
65 lines (58 loc) · 1.43 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
version: '3'
services:
app:
build:
context: .
dockerfile: ./docker/app/Dockerfile
image: app_${APP_NAME}
ports:
- "${API_PORT}:9000"
depends_on:
- db
db_init:
image: app_${APP_NAME}
entrypoint: sh
command: -c 'php artisan migrate --seed && php artisan reindex'
depends_on:
- queue-worker
db:
image: mariadb:latest
ports:
- "${DB_PORT}:3306"
volumes:
- ./docker/db/data:/var/lib/mysql
- ./docker/db/init.sql:/docker-entrypoint-initdb.d/init.sql
environment:
MYSQL_ROOT_PASSWORD: root
queue-worker:
image: app_${APP_NAME}
entrypoint: >
sh -c
'php artisan optimize \
&& php artisan config:cache \
&& php artisan queue:work --tries=1 --timeout=90 --sleep=3 --max-time=3600 --memory=512'
depends_on:
- app
crond:
image: app_${APP_NAME}
entrypoint: >
sh -c
'mkdir -p /etc/cron.d \
&& touch /etc/cron.d/crontab \
&& echo "* * * * * php /var/www/html/artisan schedule:run >> /dev/null 2>&1" > /etc/cron.d/crontab \
&& crontab /etc/cron.d/crontab \
&& crond -f'
depends_on:
- app
frontend:
build:
context: .
dockerfile: ./docker/frontend/Dockerfile
ports:
- "${FRONTEND_PORT}:3000"
depends_on:
- db_init
redis:
image: redis:7.0.9-alpine3.17
volumes:
- ./docker/redis/data:/data