Skip to content

Commit 9ed90ef

Browse files
committed
Dockerfile Optimization
1 parent 24b95ca commit 9ed90ef

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git

infra/docker/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM php:7.0-apache
44
RUN ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime
55

66
# Install last update and php extension
7-
RUN apt-get update && apt-get install -y \
7+
RUN apt-get update && apt-get install -y --no-install-recommends \
88
git \
99
vim \
1010
bzip2 \
@@ -13,7 +13,8 @@ RUN apt-get update && apt-get install -y \
1313
libmcrypt-dev \
1414
libicu-dev \
1515
&& docker-php-ext-configure mysqli \
16-
&& docker-php-ext-install mysqli pdo_mysql bz2 mcrypt intl
16+
&& docker-php-ext-install mysqli pdo_mysql bz2 mcrypt intl \
17+
&& rm -rf /var/lib/apt/lists/*
1718

1819
# Install composer
1920
RUN curl -sS https://getcomposer.org/installer | php \
@@ -26,11 +27,10 @@ RUN a2enmod rewrite
2627
COPY infra/docker/vhost.conf /etc/apache2/sites-available/000-default.conf
2728

2829
# Implement application
30+
WORKDIR /var/app
2931
COPY . /var/app/
3032

31-
RUN rm -rf /var/app/.git
32-
RUN cd /var/app; \
33-
/usr/bin/composer update; \
34-
./scripts/post-create-project
33+
RUN /usr/bin/composer update \
34+
&& ./scripts/post-create-project
3535

3636
CMD ["apache2-foreground"]

0 commit comments

Comments
 (0)