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

Avoid rebuilding Xdebug on a code change #67

Merged
merged 1 commit into from
Apr 6, 2019
Merged
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
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.




#
# 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