-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (44 loc) · 1.46 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM php:7
RUN set -ex \
&& apt-get update -y \
&& apt-get install -y \
nginx freetds-dev freetds-bin icu-devtools libicu-dev unzip \
--no-install-recommends \
&& docker-php-ext-configure pdo_dblib --with-libdir=/lib/x86_64-linux-gnu \
&& docker-php-ext-install pdo_dblib \
&& docker-php-ext-enable pdo_dblib \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \
freetds-dev libicu-dev \
&& apt-get clean \
&& rm -rf /usr/src/* \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* \
&& rm -rf /var/tmp/* \
&& for logs in `find /var/log -type f`; do > ${logs}; done \
&& rm -rf /usr/share/locale/* \
&& rm -rf /usr/share/man/* \
&& rm -rf /usr/share/doc/*
#
# composer
#
# https://getcomposer.org/download/
# https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md
#
RUN set -ex \
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php composer-setup.php \
&& mv composer.phar /usr/bin/composer \
&& rm composer-setup.php
COPY . /var/www
RUN cd /var/www \
&& composer install \
&& rm -rf html \
&& ln -s www html
WORKDIR /var/www
VOLUME /var/www/www
# forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
EXPOSE 80
STOPSIGNAL SIGTERM
CMD ["nginx", "-g", "daemon off;"]