Skip to content

Commit

Permalink
make the host ip to match real for xdebug conf, add iproute2 and net-…
Browse files Browse the repository at this point in the history
…tools
  • Loading branch information
galvani committed May 1, 2020
1 parent bb70b48 commit 98d732f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 37 deletions.
69 changes: 33 additions & 36 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,44 @@ ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8

RUN echo "export LANGUAGE=en_US.UTF-8 && export LANG=en_US.UTF-8 && export LC_ALL=en_US.UTF-8">>~/.bash_profile
RUN apt-get install -y unzip git gnupg
RUN apt-get install -y unzip gnupg
RUN locale-gen en_US.UTF-8

RUN yes | apt-get install systemd

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 11CD8CFCEEB5E8F4

RUN apt-get update && \
apt-get install -y \
libmcrypt-dev \
libicu-dev libpng-dev zlib1g-dev libedit-dev \
libxml2-dev libxslt1-dev \
apt-get install -y libmcrypt-dev \
libicu-dev \
libpng-dev \
zlib1g-dev \
libedit-dev \
libxml2-dev \
libxslt1-dev \
zlib1g-dev libzip-dev\
libc-client-dev libkrb5-dev \
curl libcurl4-openssl-dev wget vim git

RUN apt-get install -y libonig-dev
libc-client-dev \
libkrb5-dev \
curl \
libcurl4-openssl-dev \
libonig-dev \
wget \
lsb-release \
cron \
libpq-dev \
libpq5

RUN apt-get install -y iproute2 \
net-tools \
wget \
vim \
git

RUN pecl channel-update pecl.php.net
RUN pecl install igbinary
RUN pecl bundle redis && cd redis && phpize && ./configure --enable-redis-igbinary && make && make install
RUN docker-php-ext-install bcmath sockets
RUN docker-php-ext-enable igbinary redis
RUN dokcer-php-ext-install apcu opcache
RUN dokcer-php-ext-install mongo
RUN docker-php-ext-install bcmath sockets mysqli gettext
RUN docker-php-ext-enable igbinary redis gettext
RUN docker-php-source delete && rm -r /tmp/* /var/cache/*

RUN echo '\
Expand All @@ -48,58 +61,42 @@ opcache.save_comments=Off\n\

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

RUN apt-get install libpq-dev libpq5
RUN apt-get install

RUN docker-php-ext-install pdo bcmath curl gd intl json mbstring readline soap xml xmlrpc xsl zip
RUN docker-php-ext-install mysqli pdo_pgsql
RUN docker-php-ext-install mysqli pdo_mysql

RUN mkdir -p /var/run/php

RUN apt-get install -y wget lsb-release
RUN apt-get -y install cron

RUN rm -rf /var/lib/apt/lists/*

#INSTALL XDEBUG
RUN pecl install xdebug && docker-php-ext-enable xdebug
#XDEBUG

RUN echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.idekey=\"PHPSTORM\"" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_port=9000" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_port=9001" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_autostart=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote.mode=req" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote.handler=dbgp" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo xdebug.remote_host=`/sbin/ip route|awk '/default/ { print $3 }'` >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini


# INSTALL CRON FILES
COPY conf /etc/cron.d/cron
RUN chmod 0755 /etc/cron.d/cron

# Create the log file to be able to run tail
RUN touch /var/log/cron.log

RUN chmod -R 0777 /var/www/html/var/cache /var/www/html/var/log

COPY conf/php.ini /usr/local/etc/php/php.ini

# Setup email forwarding via postfix to mailhog
RUN curl -Lsf 'https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz' | tar -C '/usr/local' -xvzf -
ENV PATH /usr/local/go/bin:$PATH
RUN go get github.com/mailhog/mhsendmail
RUN cp /root/go/bin/mhsendmail /usr/bin/mhsendmail
RUN echo 'sendmail_path = /usr/bin/mhsendmail --smtp-addr mailhog:1025' >> /usr/local/etc/php/php.ini

RUN apt-get update && apt-get install -y openssh-server openssh-sftp-server
RUN mkdir ~/.ssh
COPY conf/ssh/authorized_keys /root/.ssh/
RUN chmod 700 ~/.ssh
RUN chmod 600 ~/.ssh/authorized_keys
RUN sed -i 's/^#\?PermitRootLogin .*$/PermitRootLogin without-password/' /etc/ssh/sshd_config
RUN sed -i 's/^#\?PubkeyAuthentication .*$/PubkeyAuthentication yes/' /etc/ssh/sshd_config



COPY launcher.sh /tmp/
RUN chmod +x /tmp/launcher.sh

STOPSIGNAL SIGQUIT

EXPOSE 9000
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
* pdo, mysql, pgsql
* bcmath curl gd intl json mbstring readline soap xml xmlrpc xsl zip
* composer
* xdebug on port 9000
* xdebug on port 9001
* mail routed to mailhog:1025

0 comments on commit 98d732f

Please sign in to comment.