Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pcntl extension and improve installation of others #9

Merged
merged 5 commits into from
Oct 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 21 additions & 33 deletions php-dev-8.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RUN apk add --no-cache \
RUN addgroup -S nginx \
&& adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx
RUN addgroup -g $APPLICATION_GID $APPLICATION_GROUP \
&& echo '%application ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/application \
&& echo "%$APPLICATION_GROUP ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$APPLICATION_GROUP \
&& adduser -D -u $APPLICATION_UID -s /bin/bash -G $APPLICATION_GROUP $APPLICATION_USER

RUN mkdir -p /usr/src \
Expand Down Expand Up @@ -163,48 +163,36 @@ RUN mkdir -p /opt/php-libs
COPY php/* /opt/php-libs/files/

# activate opcache and jit
RUN mv /opt/php-libs/files/opcache-jit.ini /usr/local/etc/php/conf.d/docker-php-opcache-jit.ini
RUN mv /opt/php-libs/files/opcache-jit.ini "$PHP_INI_DIR/conf.d/docker-php-opcache-jit.ini"

# install pcntl
RUN docker-php-ext-configure pcntl --enable-pcntl \
&& docker-php-ext-install pcntl

# install pcov
RUN cd /opt/php-libs \
&& git clone https://github.com/krakjoe/pcov.git \
&& cd pcov \
&& phpize \
&& ./configure --enable-pcov \
&& make \
&& make install \
&& docker-php-ext-enable pcov \
&& mv /opt/php-libs/files/pcov.ini /usr/local/etc/php/conf.d/docker-php-pcov.ini
RUN git clone --depth 1 https://github.com/krakjoe/pcov.git /usr/src/php/ext/pcov \
&& docker-php-ext-configure pcov --enable-pcov \
&& docker-php-ext-install pcov \
&& mv /opt/php-libs/files/pcov.ini "$PHP_INI_DIR/conf.d/docker-php-pcov.ini"

# install xdebug 3.0
RUN cd /opt/php-libs \
&& wget https://github.com/xdebug/xdebug/archive/$XDEBUG_VERSION.tar.gz \
&& mkdir xdebug && tar -zxC ./xdebug -f $XDEBUG_VERSION.tar.gz --strip-components 1 \
&& rm $XDEBUG_VERSION.tar.gz \
&& cd xdebug \
# the last working commit, because the php-src is not up to date yet in this alpine
&& phpize \
&& ./configure --enable-xdebug-dev \
&& make all \
&& mv /opt/php-libs/files/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& mkdir /tmp/debug \
&& chmod -R 777 /tmp/debug
RUN git clone -b $XDEBUG_VERSION --depth 1 https://github.com/xdebug/xdebug.git /usr/src/php/ext/xdebug \
&& docker-php-ext-configure xdebug --enable-xdebug-dev \
&& mv /opt/php-libs/files/xdebug.ini "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini" \
&& docker-php-ext-install xdebug \
&& mkdir /tmp/debug

# install tideways
RUN cd /opt/php-libs \
&& git clone https://github.com/tideways/php-xhprof-extension \
&& cd php-xhprof-extension \
&& phpize \
&& ./configure \
&& make \
&& make install \
&& mkdir -p /opt/docker/profiler \
&& mv /opt/php-libs/files/xhprof.ini /usr/local/etc/php/conf.d/docker-php-ext-xhprof.ini
RUN git clone --depth 1 https://github.com/tideways/php-xhprof-extension /usr/src/php/ext/xhprof \
&& docker-php-ext-configure xhprof \
&& docker-php-ext-install xhprof \
&& mkdir -p /opt/docker/profiler \
&& mv /opt/php-libs/files/xhprof.ini "$PHP_INI_DIR/conf.d/docker-php-ext-xhprof.ini"

RUN curl https://raw.githubusercontent.com/git/git/v$(git --version | awk 'NF>1{print $NF}')/contrib/completion/git-completion.bash > /root/.git-completion.bash \
&& curl https://raw.githubusercontent.com/git/git/v$(git --version | awk 'NF>1{print $NF}')/contrib/completion/git-prompt.sh > /root/.git-prompt.sh
RUN mkdir -p /var/log/supervisord
EXPOSE 80 443 9000
EXPOSE 80 443 9003
CMD ["/usr/bin/supervisord", "-nc", "/opt/docker/supervisord.conf"]

WORKDIR /app
1 change: 0 additions & 1 deletion php/xdebug.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# @see https://3.xdebug.org/docs/all_settings
zend_extension=/opt/php-libs/xdebug/modules/xdebug.so
xdebug.mode=profile,develop,coverage
# xdebug.client_host =
xdebug.client_port=9003
Expand Down
1 change: 0 additions & 1 deletion php/xhprof.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
extension=tideways_xhprof.so
#auto_prepend_file=/opt/php-libs/files/profiler.php