-
Notifications
You must be signed in to change notification settings - Fork 8
/
docker-compose.yml
62 lines (56 loc) · 1.65 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
version: '3.7'
services:
nginx-proxy:
image: jwilder/nginx-proxy
ports:
- 80:80
volumes:
- ./images/nginx-proxy/certs:/etc/nginx/certs:ro
- ./images/nginx-proxy/vhost.d:/etc/nginx/vhost.d:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
php-fpm:
build: ./images/php-fpm
volumes:
- ./images/php-fpm/php.ini:/usr/local/etc/php/php.ini
- ../:/var/www/html:delegated
environment:
DB_CONNECTION: mysql
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: $MYSQL_DATABASE
DB_USERNAME: $MYSQL_USER
DB_PASSWORD: $MYSQL_PASSWORD
nginx-app:
image: nginx
links:
- php-fpm
volumes:
- ./images/nginx/vhost.conf:/etc/nginx/conf.d/default.conf
- ../:/var/www/html:delegated
environment:
VIRTUAL_HOST: $VIRTUAL_HOST
LETSENCRYPT_HOST: $LETSENCRYPT_HOST
LETSENCRYPT_EMAIL: $LETSENCRYPT_EMAIL
db:
image: mysql:8.0
ports:
# We need to expose this port to allow to connect to the database via DBMS
- 3306:3306
# see https://github.com/laravel/framework/issues/23961#issuecomment-385446928
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PASSWORD
MYSQL_USER: $MYSQL_USER
MYSQL_PASSWORD: $MYSQL_PASSWORD
MYSQL_DATABASE: $MYSQL_DATABASE
volumes:
- ./data/mysql/:/docker-entrypoint-initdb.d
- data_volume:/var/lib/mysql
composer:
build: ./images/php-fpm
command: composer install --optimize-autoloader --no-interaction
working_dir: /var/www/html
volumes:
- ../:/var/www/html:delegated
volumes:
data_volume: