Skip to content

Instantly share code, notes, and snippets.

@rtio
Last active July 1, 2020 23:04
Show Gist options
  • Select an option

  • Save rtio/faf141d4f29212c136606136494e6f7b to your computer and use it in GitHub Desktop.

Select an option

Save rtio/faf141d4f29212c136606136494e6f7b to your computer and use it in GitHub Desktop.
Docker
version: '3'
services:
db:
image: mysql:5.7
container_name: db
networks:
- isolated_nw
environment:
MYSQL_DATABASE: databasename
MYSQL_ROOT_PASSWORD: databasepass
api:
build: .
image: server:1.0
container_name: api
volumes:
- /home/rtio/rtio-src/server:/var/www/server.dev
tty: true
ports:
- "8080:80"
networks:
- isolated_nw
environment:
XDEBUG_CONFIG: "remote_host=192.168.1.6"
PHP_IDE_CONFIG: "serverName=Test"
networks:
isolated_nw:
driver: bridge
FROM debian
RUN mkdir -p /var/www/server.dev/web
WORKDIR /var/www/server.dev
RUN apt-get update && apt-get install -y \
aptitude \
apt-utils \
pkg-config \
libpcre3-dev \
libzip-dev \
git \
openssh-client \
libssl-dev \
curl \
vim \
nano
RUN apt-get install -y \
apache2 \
php5 \
php-pear \
php5-mysql \
php5-curl \
php5-gd \
php5-intl \
php5-imagick \
php5-mcrypt \
php5-memcache \
php5-apcu
ENV XDEBUGINI_PATH=/etc/php5/apache2/conf.d/xdebug.ini
RUN echo "zend_extension="`find /usr/lib/php5/20131226/ -iname 'xdebug.so'` > $XDEBUGINI_PATH
COPY xdebug.ini /tmp/xdebug.ini
RUN cat /tmp/xdebug.ini >> $XDEBUGINI_PATH
RUN echo "xdebug.remote_host="`/sbin/ip route|awk '/default/ { print $3 }'` >> $XDEBUGINI_PATH
# ENABLE MOD_REWRITE
RUN a2enmod rewrite
# INSTALL COMPOSER
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/bin --filename=composer
# ALTER CONFIG
COPY conf/php.ini /etc/apache2/cli/php.ini
COPY conf/apache2.conf /etc/apache2/apache2.conf
COPY conf/000-default.conf /etc/apache2/sites-available/000-default.conf
CMD ["-D", "FOREGROUND"]
ENTRYPOINT ["apachectl"]
xdebug.remote_enable=on
xdebug.remote_autostart=on
xdebug.remote_connect_back=off
xdebug.remote_handler=dbgp
xdebug.profiler_enable=0
xdebug.profiler_output_dir="/var/www/server.dev"
xdebug.remote_port=9000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment