Last active
November 29, 2016 20:35
-
-
Save majorgreys/c6278ba3b9860aaf412fbec43cce37a8 to your computer and use it in GitHub Desktop.
Headaches with docker-compose and xdebug
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: '2' | |
services: | |
db: | |
image: mysql:5.7 | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: wordpress | |
MYSQL_DATABASE: wordpress | |
MYSQL_USER: wordpress | |
MYSQL_PASSWORD: wordpress | |
web: | |
depends_on: | |
- db | |
# image: wordpress | |
links: | |
- db | |
ports: | |
- 80:80 | |
restart: always | |
build: . | |
environment: | |
WORDPRESS_DB_HOST: db:3306 | |
WORDPRESS_DB_NAME: wordpress | |
WORDPRESS_DB_USER: wordpress | |
WORDPRESS_DB_PASSWORD: wordpress | |
XDEBUG_CONFIG: 10.0.1.2 | |
volumes: | |
- ./../cac:/var/www/html |
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
FROM wordpress | |
RUN yes | pecl install xdebug \ | |
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \ | |
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \ | |
&& echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment