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

Commit be1abba

Browse files
Avoid rebuilding Xdebug on a code change (#67)
1 parent ef47d36 commit be1abba

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

Dockerfile

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
FROM php:7.2.11-fpm-alpine AS php
2+
3+
ENV PHP_EXTENSION_DIR=/usr/local/lib/php/extensions/no-debug-non-zts-20170718
4+
5+
6+
17
#
28
# Stage: Composer install for production
39
#
@@ -20,7 +26,7 @@ RUN composer --no-interaction dump-autoload --classmap-authoritative
2026
#
2127
# Stage: Production environment
2228
#
23-
FROM php:7.2.11-fpm-alpine AS prod
29+
FROM php AS prod
2430

2531
WORKDIR /app
2632

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

115121

116122
#
117-
# Stage: Debug environment
123+
# Stage: Install Xdebug
118124
#
119-
FROM dev AS debug
125+
FROM php AS xdebug
120126

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

137+
138+
139+
#
140+
# Stage: Debug environment
141+
#
142+
FROM dev AS debug
143+
144+
COPY --from=xdebug ${PHP_EXTENSION_DIR}/*.so ${PHP_EXTENSION_DIR}/
145+
COPY --from=xdebug ${PHP_INI_DIR}/conf.d/*.ini ${PHP_INI_DIR}/conf.d/
146+
131147
COPY .docker/php-debug.ini ${PHP_INI_DIR}/conf.d/02-app.ini

0 commit comments

Comments
 (0)