Created
December 16, 2019 17:13
-
-
Save ihpr/08212ec5de0ee48195c857b1bc69ee82 to your computer and use it in GitHub Desktop.
Docker compose example for Symfony apps
This file contains hidden or 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: | |
composer: | |
image: composer | |
working_dir: /var/www/playground | |
volumes: | |
- .:/var/www/playground | |
php: | |
build: | |
context: . | |
ports: | |
- 9000 | |
expose: | |
- 9000 | |
working_dir: /var/www/playground | |
volumes: | |
- .:/var/www/playground | |
- ./etc/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini | |
mysql: | |
image: mysql:8 | |
environment: | |
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} | |
MYSQL_DATABASE: ${MYSQL_DATABASE} | |
MYSQL_USER: ${MYSQL_USER} | |
MYSQL_PASSWORD: ${MYSQL_PASSWORD} | |
command: --default-authentication-plugin=mysql_native_password | |
volumes: | |
- ./var/data/mysql:/var/lib/mysql | |
nginx: | |
image: nginx:1.17 | |
expose: | |
- 8001 | |
ports: | |
- 8001:80 | |
working_dir: /var/www/playground | |
volumes: | |
- ./public:/var/www/playground/public | |
- ./etc/nginx.conf:/etc/nginx/conf.d/default.conf | |
- ./var/log/nginx:/var/log/nginx | |
command: /bin/bash -c "exec nginx -g 'daemon off;'" | |
depends_on: | |
- php | |
- mysql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment