-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·105 lines (105 loc) · 2.58 KB
/
docker-compose.yml
File metadata and controls
executable file
·105 lines (105 loc) · 2.58 KB
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
version: '3'
services:
mysql:
image: mariadb:latest
container_name: mysql-library
volumes:
- ~/.docker/mariadb:/var/lib/mysql
ports:
- "3306:3306"
env_file:
- docker/docker-compose-env/database.env
redis:
image: redis:alpine
container_name: redis-library
command: ['redis-server', '--bind','0.0.0.0','--requirepass', 'testes','--port','6380']
volumes:
- redis-data:/data
ports:
- "6380:6380"
php:
build:
context: .
dockerfile: ./docker/php8-fpm/Dockerfile
image: repo-registry-local/libraryapitest-app-example:v4.0
container_name: php-library-example
depends_on:
- redis
- mysql
- rabbitmq
command: bash -c "php artisan migrate && php-fpm"
env_file:
- docker/docker-compose-env/application.env
links:
- mysql
- redis
- rabbitmq
volumes:
- ./application/:/app:rw
- /app/vendor
worker-php:
build:
context: .
dockerfile: ./docker/php8-fpm/Dockerfile
image: libraryapiotra:php-worker-example
container_name: php-library-example-worker
depends_on:
- mysql
command: sh -c "crontab scheduler.txt; cron -f; php-fpm ; php-fpm -v"
env_file:
- docker/docker-compose-env/application.env
environment:
APP_NAME: 'Scheduler - Library API'
links:
- mysql
- redis
volumes:
- ./application/:/app:rw
- /app/vendor
worker-queue:
build:
context: .
dockerfile: ./docker/php8-fpm/Dockerfile
image: libraryapiotra:php-worker-queue
container_name: php-library-worker-queue-example
depends_on:
- mysql
- rabbitmq
command: sh -c "php /app/artisan queue:work --verbose --tries=7 --timeout=90"
env_file:
- docker/docker-compose-env/application.env
environment:
APP_NAME: 'Queue Worker - Library API'
links:
- mysql
- redis
- rabbitmq
volumes:
- ./application/:/app:rw
- /app/vendor
web:
image: nginx:1.19-alpine
container_name: nginx-library
depends_on:
- php
volumes:
- ./docker/nginx/default:/etc/nginx/conf.d/default.conf
- ./docker/nginx/certs:/etc/nginx/certs
- ./application/:/app:rw
ports:
- 443:443
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: rabbitmq
volumes:
- ~/.docker/rabbitmq/data/:/var/lib/rabbitmq/
env_file:
- docker/docker-compose-env/messagequeue.env
ports:
- 5672:5672
- 15672:15672
volumes:
redis-data:
driver: "local"
mysql-data:
driver: "local"