Skip to content

Instantly share code, notes, and snippets.

@wilcorrea
Created October 16, 2019 01:54
Show Gist options
  • Save wilcorrea/058e0d957e231d68590ab2c009121765 to your computer and use it in GitHub Desktop.
Save wilcorrea/058e0d957e231d68590ab2c009121765 to your computer and use it in GitHub Desktop.
# configure grep regEx to your ifcongig output
export XDEBUG_REMOTE_HOST=$(ifconfig wlp6s0 | grep -oE 'inet [[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}' | cut -c6-)
version: '3'
# volumes
volumes:
xxx-database_data:
driver: local
# services
services:
# PHP service to provide api
xxx-app:
container_name: xxx-app
image: webdevops/php-nginx-dev:7.2
working_dir: /var/www/app
volumes:
- .:/var/www/app
environment:
- WEB_DOCUMENT_ROOT=/var/www/app/public
- WEB_DOCUMENT_INDEX=index.php
- PHP_MAX_EXECUTION_TIME=86400
- PHP_DEBUGGER=xdebug
- XDEBUG_REMOTE_PORT=9000
- XDEBUG_REMOTE_AUTOSTART=on
- XDEBUG_REMOTE_CONNECT_BACK=on
- XDEBUG_REMOTE_HOST=${XDEBUG_REMOTE_HOST}
ports:
- 80:80
# MySQL database service
xxx-database:
image: mysql:5.7
container_name: xxx-database
volumes:
- .:/var/www/app
- xxx-database_data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=database
- MYSQL_USER=user
- MYSQL_PASSWORD=password
ports:
- 3306:3306
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment