Skip to content

Commit 0717e58

Browse files
author
Julien Neuhart
committed
remving default PHP-FPM PHP conf + linking apache2 and fpm with the default php conf
1 parent e12618d commit 0717e58

File tree

5 files changed

+44
-13
lines changed

5 files changed

+44
-13
lines changed

Dockerfile.slim.apache

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,15 @@ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
6969

7070
ENV TEMPLATE_PHP_INI=development
7171

72-
# Let's remove the default php.ini files (they will be copied from TEMPLATE_PHP_INI)
73-
RUN rm /etc/php/${PHP_VERSION}/cli/php.ini &&\
74-
rm /etc/php/${PHP_VERSION}/apache2/php.ini
72+
# Let's remove the default CLI php.ini file (it will be copied from TEMPLATE_PHP_INI)
73+
RUN rm /etc/php/${PHP_VERSION}/cli/php.ini
74+
75+
76+
# Let's remove the default Apache php.ini file (it will be copied from TEMPLATE_PHP_INI)
77+
RUN rm /etc/php/${PHP_VERSION}/apache2/php.ini
78+
79+
80+
7581

7682

7783
# |--------------------------------------------------------------------------

Dockerfile.slim.cli

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,12 @@ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
6969

7070
ENV TEMPLATE_PHP_INI=development
7171

72-
# Let's remove the default php.ini files (they will be copied from TEMPLATE_PHP_INI)
73-
RUN rm /etc/php/${PHP_VERSION}/cli/php.ini &&\
74-
rm /etc/php/${PHP_VERSION}/apache2/php.ini
72+
# Let's remove the default CLI php.ini file (it will be copied from TEMPLATE_PHP_INI)
73+
RUN rm /etc/php/${PHP_VERSION}/cli/php.ini
74+
75+
76+
77+
7578

7679

7780
# |--------------------------------------------------------------------------

Dockerfile.slim.fpm

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,15 @@ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
6969

7070
ENV TEMPLATE_PHP_INI=development
7171

72-
# Let's remove the default php.ini files (they will be copied from TEMPLATE_PHP_INI)
73-
RUN rm /etc/php/${PHP_VERSION}/cli/php.ini &&\
74-
rm /etc/php/${PHP_VERSION}/apache2/php.ini
72+
# Let's remove the default CLI php.ini file (it will be copied from TEMPLATE_PHP_INI)
73+
RUN rm /etc/php/${PHP_VERSION}/cli/php.ini
74+
75+
76+
77+
78+
# Let's remove the default PHP-FPM php.ini file (it will be copied from TEMPLATE_PHP_INI)
79+
RUN rm /etc/php/${PHP_VERSION}/fpm/php.ini
80+
7581

7682

7783
# |--------------------------------------------------------------------------

utils/Dockerfile.slim.blueprint

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,18 @@ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
7171

7272
ENV TEMPLATE_PHP_INI=development
7373

74-
# Let's remove the default php.ini files (they will be copied from TEMPLATE_PHP_INI)
75-
RUN rm /etc/php/${PHP_VERSION}/cli/php.ini &&\
76-
rm /etc/php/${PHP_VERSION}/apache2/php.ini
74+
# Let's remove the default CLI php.ini file (it will be copied from TEMPLATE_PHP_INI)
75+
RUN rm /etc/php/${PHP_VERSION}/cli/php.ini
76+
77+
{{if eq $variant "apache" }}
78+
# Let's remove the default Apache php.ini file (it will be copied from TEMPLATE_PHP_INI)
79+
RUN rm /etc/php/${PHP_VERSION}/apache2/php.ini
80+
{{end}}
81+
82+
{{if eq $variant "fpm" }}
83+
# Let's remove the default PHP-FPM php.ini file (it will be copied from TEMPLATE_PHP_INI)
84+
RUN rm /etc/php/${PHP_VERSION}/fpm/php.ini
85+
{{end}}
7786

7887

7988
# |--------------------------------------------------------------------------

utils/docker-entrypoint-as-root.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@ touch /opt/container_started
77

88
# Let's apply the requested php.ini file
99

10-
# TODO: APACHE AND PHP-FPM
1110
if [ ! -f /etc/php/${PHP_VERSION}/cli/php.ini ] || [ -L /etc/php/${PHP_VERSION}/cli/php.ini ]; then
1211
ln -sf /usr/lib/php/${PHP_VERSION}/php.ini-${TEMPLATE_PHP_INI} /etc/php/${PHP_VERSION}/cli/php.ini
1312
fi
1413

14+
if [[ "$IMAGE_VARIANT" == "apache" ]]; then
15+
ln -sf /usr/lib/php/${PHP_VERSION}/php.ini-${TEMPLATE_PHP_INI} /etc/php/${PHP_VERSION}/apache2/php.ini
16+
fi
17+
18+
if [[ "$IMAGE_VARIANT" == "fpm" ]]; then
19+
ln -sf /usr/lib/php/${PHP_VERSION}/php.ini-${TEMPLATE_PHP_INI} /etc/php/${PHP_VERSION}/fpm/php.ini
20+
fi
21+
1522
# Let's find the user to use for commands.
1623
# If $DOCKER_USER, let's use this. Otherwise, let's find it.
1724
if [[ "$DOCKER_USER" == "" ]]; then

0 commit comments

Comments
 (0)