Skip to content

Instantly share code, notes, and snippets.

@datio
Last active June 10, 2018 19:10
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 datio/c61a16eb29f3442db83ba65d3727bf72 to your computer and use it in GitHub Desktop.
Save datio/c61a16eb29f3442db83ba65d3727bf72 to your computer and use it in GitHub Desktop.
XF2 Docker Container: Dockerfile for XenForo2 with Xdebug
FROM php:apache
RUN apt update && apt upgrade -y && apt-get autoremove -y \
&& apt install -y libfreetype6-dev && apt install -y libpng-dev \
&& apt install -y libjpeg62-turbo-dev && apt install -y libxml2-dev \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install gd && docker-php-ext-install mysqli && docker-php-ext-install zip && docker-php-ext-install xml \
&& a2enmod rewrite \
&& 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
@datio
Copy link
Author

datio commented Apr 14, 2018

The docker-compose.yml contents, where I run it from:

services:
  httpd_php:
    build:
      context: xenforo2
      dockerfile: Dockerfile
    ports:
      - "9090:80"
    volumes:
      - "/var/xenforo2:/var/www/html:rw"
    environment:
      XDEBUG_CONFIG: "remote_host=172.17.0.1"
    links:
      - mariadb
    restart: "no"
  mariadb:
    image: mariadb
    volumes:
      - "./mariadb:/var/lib/mysql:rw"
      - "./my.cnf:/etc/mysql/my.cnf"
    environment:
      - "MYSQL_ROOT_PASSWORD=pass"
    ports:
      - "3307:3306"
    restart: "no"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment