Created
November 8, 2018 17:55
-
-
Save armyofda12mnkeys/013b2d6a1c8f5e1a6df47925cbd2fc02 to your computer and use it in GitHub Desktop.
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 php:7.2.11-apache | |
MAINTAINER Admin | |
WORKDIR /var/www/html/my_cms/ | |
COPY ./site/ /var/www/html/my_cms/site/ | |
COPY .docker/vhost.conf /etc/apache2/sites-available/000-default.conf | |
#not sure if sudo needed in container env | |
RUN apt-get update -y && apt-get install -y sudo vim net-tools iputils-ping mysql-client git zip unzip libpng-dev libjpeg-dev libfreetype6-dev libxml2-dev \ | |
&& pecl install xdebug-2.6.1 \ | |
&& echo 'zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so"' >> /usr/local/etc/php/php.ini \ | |
&& echo 'xdebug.default_enable=1' >> /usr/local/etc/php/php.ini \ | |
# Skype on Windows sometimes uses 9000, so changed to 9003, make sure to make your IDE debugger use this IP too | |
&& echo 'xdebug.remote_port=9003' >> /usr/local/etc/php/php.ini \ | |
&& echo 'xdebug.remote_enable=1' >> /usr/local/etc/php/php.ini \ | |
# remote_connect_back does not work on Windows, and manually needs the remote_host i.p.!!! | |
&& echo 'xdebug.remote_connect_back=0' >> /usr/local/etc/php/php.ini \ | |
# some options to try: ping docker.for.win.host.internal, ping docker.for.win.localhost, ping host.docker.internal, ipconfig DockerNat 10.0.75.1, 172.18.0.1 | |
&& echo 'xdebug.remote_host=host.docker.internal' >> /usr/local/etc/php/php.ini \ | |
&& echo 'xdebug.remote_autostart=1' >> /usr/local/etc/php/php.ini \ | |
&& echo 'xdebug.idekey=XDEBUG_ECLIPSE' >> /usr/local/etc/php/php.ini \ | |
&& echo 'xdebug.remote_handler=dbgp' >> /usr/local/etc/php/php.ini \ | |
&& echo 'xdebug.remote_log=/var/www/html/my_cms/xdebug.log' >> /usr/local/etc/php/php.ini \ | |
&& echo 'date.timezone="America/New_York"' >> /usr/local/etc/php/php.ini \ | |
&& echo 'error_log=/var/www/html/my_cms/php_errors.txt' >> /usr/local/etc/php/php.ini \ | |
&& touch /var/www/html/my_cms/xdebug.log \ | |
&& touch /var/www/html/my_cms/php_errors.txt \ | |
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ | |
&& docker-php-ext-install pdo_mysql mysqli gd gettext soap sockets \ | |
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ | |
&& cd site && composer install --no-interaction \ | |
&& a2enmod rewrite \ | |
&& a2enmod proxy && a2enmod proxy_http \ | |
&& chown -R www-data:www-data /var/www/html/my_cms \ | |
&& chmod -R 775 /var/www/html/my_cms |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment