-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
80 lines (64 loc) · 3 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
FROM php:7.2-fpm-stretch
LABEL maintainer "https://github.com/amq/"
# packages and php modules
RUN buildDeps="libxml2-dev zlib1g-dev" \
&& apt-get update -y \
&& apt-get install -y $buildDeps unzip git gnupg dirmngr --no-install-recommends --no-install-suggests \
&& pecl install redis xdebug \
&& docker-php-ext-enable redis xdebug \
&& docker-php-ext-install opcache pdo_mysql mysqli soap zip \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDeps
# cphalcon
ENV PHALCON_VERSION=3.4.2
RUN curl -LO https://github.com/phalcon/cphalcon/archive/v${PHALCON_VERSION}.tar.gz \
&& tar xzf v${PHALCON_VERSION}.tar.gz \
&& docker-php-ext-install ${PWD}/cphalcon-${PHALCON_VERSION}/build/php7/64bits \
&& rm -rf v${PHALCON_VERSION}.tar.gz cphalcon-${PHALCON_VERSION}
# devtools
ENV DEVTOOLS_VERSION=3.4.1
RUN curl -LO https://github.com/phalcon/phalcon-devtools/archive/v${DEVTOOLS_VERSION}.tar.gz \
&& tar xzf v${DEVTOOLS_VERSION}.tar.gz \
&& mv phalcon-devtools-${DEVTOOLS_VERSION} /usr/local/phalcon-devtools \
&& ln -s /usr/local/phalcon-devtools/phalcon.php /usr/local/bin/phalcon \
&& rm -f v${DEVTOOLS_VERSION}.tar.gz
# composer
ENV COMPOSER_VERSION=1.8.3
RUN curl -L https://getcomposer.org/installer -o composer-setup.php \
&& php composer-setup.php --version=${COMPOSER_VERSION} --install-dir=/usr/local/bin --filename=composer \
&& rm -f composer-setup.php
WORKDIR /app
RUN sed -ri 's/^www-data:x:33:33:/www-data:x:1000:1000:/' /etc/passwd
RUN sed -i '/^access.log/ s/^/;/' /usr/local/etc/php-fpm.d/docker.conf
ENV NGINX_VERSION 1.15.8-1~stretch
RUN set -e; \
NGINX_GPGKEY=573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62; \
found=''; \
for server in \
ha.pool.sks-keyservers.net \
hkp://keyserver.ubuntu.com:80 \
hkp://p80.pool.sks-keyservers.net:80 \
pgp.mit.edu \
; do \
echo "Fetching GPG key $NGINX_GPGKEY from $server"; \
apt-key adv --no-tty --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$NGINX_GPGKEY" && found=yes && break; \
done; \
test -z "$found" && echo >&2 "error: failed to fetch GPG key $NGINX_GPGKEY" && exit 1; \
exit 0
RUN echo "deb http://nginx.org/packages/mainline/debian/ stretch nginx" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y \
ca-certificates \
nginx=${NGINX_VERSION} \
nginx-module-geoip \
nginx-module-image-filter \
gettext-base \
supervisor \
&& rm -rf /var/lib/apt/lists/*
# 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
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
CMD ["supervisord"]