-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
130 lines (127 loc) · 3.47 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
version: '3.8'
services:
app:
container_name: ${DOCKER_APP_CONTAINER_NAME}
extra_hosts:
- "host.docker.internal:host-gateway"
build:
context: .
dockerfile: Dockerfile
command: php artisan serve --host=0.0.0.0
volumes:
- .:/app
ports:
- ${DOCKER_EXPOSED_ARTISAN_SERVE_PORT}:8000
depends_on:
- db
- composer
networks:
- proxynet
env_file:
- .env
queue:
container_name: ${DOCKER_APP_CONTAINER_NAME}-queue
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- .:/app
build:
context: .
dockerfile: Dockerfile
command: 'php artisan queue:work'
environment:
- REDIS_HOST=${REDIS_HOST}
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_PORT=${REDIS_PORT}
depends_on:
- app
- cache
- db
- composer
networks:
- proxynet
db:
container_name: ${DOCKER_APP_CONTAINER_NAME}-db
platform: linux/x86_64
image: mysql:8.0
restart: "no"
environment:
MYSQL_ROOT: root
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_USER: ${DB_USERNAME}
MYSQL_PASSWORD: ${DB_PASSWORD}
ports:
- ${DOCKER_EXPOSED_DB_PORT}:3306
volumes:
- db_data:/var/lib/mysql
networks:
- proxynet
env_file:
- .env
cache:
container_name: ${DOCKER_APP_CONTAINER_NAME}-cache
command: redis-server --requirepass ${REDIS_PASSWORD}
image: redis:5.0
ports:
- :6379
volumes:
- cache_data:/data
networks:
- proxynet
nginx:
image: nginx:stable-alpine
container_name: ${DOCKER_APP_CONTAINER_NAME}-nginx
ports:
- ${DOCKER_EXPOSED_NGINX_PORT}:80
volumes:
- ./:/var/www/html
- ./.docker/nginx/default.conf:/etc/nginx/conf.d/default.temp
depends_on:
- app
- composer
- db
- cache
command: /bin/sh -c "envsubst '$$DOCKER_NGINX_LOCAL_IP $$DOCKER_APP_CONTAINER_NAME' < /etc/nginx/conf.d/default.temp > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"
env_file:
- .env
networks:
- proxynet
php-fpm:
extra_hosts:
- "host.docker.internal:host-gateway"
build:
dockerfile: Dockerfile.PHP-FPM
container_name: ${DOCKER_APP_CONTAINER_NAME}-php-fpm
volumes:
- ./.docker/xdebug-nginx.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
- ./:/var/www/html
ports:
- ":9000"
depends_on:
- app
- composer
- db
- cache
networks:
- proxynet
composer:
build:
context: .
dockerfile: Dockerfile
container_name: ${DOCKER_APP_CONTAINER_NAME}-composer
volumes:
- .:/app
command: composer install
networks:
- proxynet
env_file:
- .env
volumes:
db_data:
driver: "local"
cache_data:
driver: "local"
networks:
proxynet:
name: laravle-dev-to-network