Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

Commit

Permalink
Avoid rebuilding Xdebug on a code change (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
thewilkybarkid authored Apr 6, 2019
1 parent ef47d36 commit be1abba
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
FROM php:7.2.11-fpm-alpine AS php

ENV PHP_EXTENSION_DIR=/usr/local/lib/php/extensions/no-debug-non-zts-20170718



#
# Stage: Composer install for production
#
Expand All @@ -20,7 +26,7 @@ RUN composer --no-interaction dump-autoload --classmap-authoritative
#
# Stage: Production environment
#
FROM php:7.2.11-fpm-alpine AS prod
FROM php AS prod

WORKDIR /app

Expand Down Expand Up @@ -114,9 +120,9 @@ RUN bin/console assets:install && \


#
# Stage: Debug environment
# Stage: Install Xdebug
#
FROM dev AS debug
FROM php AS xdebug

RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
pecl install \
Expand All @@ -128,4 +134,14 @@ RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
apk del .build-deps && \
rm -rf /var/cache/apk/



#
# Stage: Debug environment
#
FROM dev AS debug

COPY --from=xdebug ${PHP_EXTENSION_DIR}/*.so ${PHP_EXTENSION_DIR}/
COPY --from=xdebug ${PHP_INI_DIR}/conf.d/*.ini ${PHP_INI_DIR}/conf.d/

COPY .docker/php-debug.ini ${PHP_INI_DIR}/conf.d/02-app.ini

0 comments on commit be1abba

Please sign in to comment.