Skip to content

Instantly share code, notes, and snippets.

@majorgreys
Last active November 29, 2016 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save majorgreys/c6278ba3b9860aaf412fbec43cce37a8 to your computer and use it in GitHub Desktop.
Save majorgreys/c6278ba3b9860aaf412fbec43cce37a8 to your computer and use it in GitHub Desktop.
Headaches with docker-compose and xdebug
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
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