Skip to content

Commit 195c6e0

Browse files
authored
Merge pull request maxpou#107 from satoru-k/feature/issue-57
Optimized Dockerfile
2 parents 0b1c70e + 9456527 commit 195c6e0

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

nginx/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ RUN apt-get update && apt-get install -y \
88
ADD nginx.conf /etc/nginx/
99
ADD symfony.conf /etc/nginx/sites-available/
1010

11-
RUN ln -s /etc/nginx/sites-available/symfony.conf /etc/nginx/sites-enabled/symfony
12-
RUN rm /etc/nginx/sites-enabled/default
11+
RUN ln -s /etc/nginx/sites-available/symfony.conf /etc/nginx/sites-enabled/symfony \
12+
&& rm /etc/nginx/sites-enabled/default
1313

1414
RUN echo "upstream php-upstream { server php:9000; }" > /etc/nginx/conf.d/upstream.conf
1515

php7-fpm/Dockerfile

+18-18
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@ RUN apt-get update && apt-get install -y \
1010
unzip
1111

1212
# Install Composer
13-
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
14-
RUN composer --version
13+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
14+
&& composer --version
1515

1616
# Set timezone
17-
RUN ln -snf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime && echo ${TIMEZONE} > /etc/timezone
18-
RUN printf '[PHP]\ndate.timezone = "%s"\n', ${TIMEZONE} > /usr/local/etc/php/conf.d/tzone.ini
19-
RUN "date"
17+
RUN ln -snf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime && echo ${TIMEZONE} > /etc/timezone \
18+
&& printf '[PHP]\ndate.timezone = "%s"\n', ${TIMEZONE} > /usr/local/etc/php/conf.d/tzone.ini \
19+
&& "date"
2020

2121
# Type docker-php-ext-install to see available extensions
2222
RUN docker-php-ext-install pdo pdo_mysql
2323

2424

2525
# install xdebug
26-
RUN pecl install xdebug
27-
RUN docker-php-ext-enable xdebug
28-
RUN echo "error_reporting = E_ALL" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
29-
RUN echo "display_startup_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
30-
RUN echo "display_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
31-
RUN echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
32-
RUN echo "xdebug.remote_connect_back=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
33-
RUN echo "xdebug.idekey=\"PHPSTORM\"" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
34-
RUN echo "xdebug.remote_port=9001" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
35-
36-
37-
RUN echo 'alias sf="php app/console"' >> ~/.bashrc
38-
RUN echo 'alias sf3="php bin/console"' >> ~/.bashrc
26+
RUN pecl install xdebug \
27+
&& docker-php-ext-enable xdebug \
28+
&& echo "error_reporting = E_ALL" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
29+
&& echo "display_startup_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
30+
&& echo "display_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
31+
&& echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
32+
&& echo "xdebug.remote_connect_back=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
33+
&& echo "xdebug.idekey=\"PHPSTORM\"" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
34+
&& echo "xdebug.remote_port=9001" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
35+
36+
37+
RUN echo 'alias sf="php app/console"' >> ~/.bashrc \
38+
&& echo 'alias sf3="php bin/console"' >> ~/.bashrc
3939

4040
WORKDIR /var/www/symfony

0 commit comments

Comments
 (0)