Created
October 19, 2017 13:05
-
-
Save yuklia/7c4163213b89ccdfb85bc6d7b614b9f7 to your computer and use it in GitHub Desktop.
Dockerize Laravel with related services: mysql, nginx, php-fpm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
db: | |
image: mysql | |
environment: | |
- MYSQL_ROOT_PASSWORD=np2Kmh5g | |
- MYSQL_DATABASE=lara_play | |
ports: | |
- "3311:3306" | |
volumes: | |
- mysqldata:/var/lib/mysql | |
- ./db/custom.cnf:/etc/mysql/conf.d/custom.cnf | |
- ./db/mysql-slow.log:/var/log/mysql/mysql-slow.log | |
php: | |
build: ./php | |
hostname: phpfpm | |
volumes: | |
- ./../:/var/www | |
environment: | |
- XDEBUG_CONFIG=remote_host=10.254.254.254 | |
- PHP_IDE_CONFIG=serverName=lara.play # for console debugging | |
links: | |
- db | |
nginx: | |
image: nginx | |
volumes: | |
- ./nginx/prx.conf:/prx.conf | |
- ./../:/var/www | |
ports: | |
- "8089:80" | |
environment: | |
- NGINX_HOST=lara.play | |
- NGINX_PORT=80 | |
command: /bin/bash -c "envsubst '$$NGINX_HOST $$NGINX_PORT' < /prx.conf > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'" | |
links: | |
- php | |
volumes: | |
mysqldata: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment