forked from devigner/docker-compose-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
58 lines (50 loc) · 1.41 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
# PHP
version: '2'
services:
phpfpm:
build: ./.docker/images/php-fpm
volumes:
- ./.docker/images/php-fpm/php-fpm.conf:/usr/local/etc/php-fpm.conf
- ./.docker/images/php-fpm/php.ini:/usr/local/etc/php/php.ini
- ./app:/var/www/html
nginx-proxy:
image: jwilder/nginx-proxy:alpine
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./.docker/images/proxy/certs:/etc/nginx/certs:ro
- ./.docker/images/proxy/vhost.d:/etc/nginx/vhost.d
- ./.docker/images/proxy/html:/usr/share/nginx/html
nginx-letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
volumes_from:
- nginx-proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./.docker/images/proxy/certs:/etc/nginx/certs:rw
nginx-app:
image: nginx
volumes:
- ./.docker/images/nginx/vhost.conf:/etc/nginx/conf.d/default.conf
- ./app:/var/www/html
environment:
VIRTUAL_HOST: $VIRTUAL_HOST
LETSENCRYPT_HOST: $LETSENCRYPT_HOST
LETSENCRYPT_EMAIL: $LETSENCRYPT_EMAIL
# MYSQL
db:
image: mysql
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: 123456
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_DATABASE: database
volumes:
- ./.docker/data/mysql/:/docker-entrypoint-initdb.d
- data_volume:/var/lib/mysql
volumes:
data_volume: