-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
62 lines (48 loc) · 1.89 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
FROM php:7.2-fpm-alpine
LABEL maintainer "https://github.com/amq/"
# php modules
ENV PHALCON_VERSION=3.4.2
RUN apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
libxml2-dev \
zlib-dev \
&& pecl install redis xdebug \
&& docker-php-ext-enable redis xdebug \
&& docker-php-ext-install opcache pdo_mysql mysqli soap zip \
# cphalcon
&& 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} \
&& apk del .build-deps
# packages
RUN apk add --no-cache \
git \
nginx \
nginx-mod-http-image-filter \
nginx-mod-stream-geoip \
runit \
unzip
# 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:82:82:/www-data:x:1000:1000:/' /etc/passwd
RUN sed -i '/^access.log/ s/^/;/' /usr/local/etc/php-fpm.d/docker.conf
# 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 runit /etc/runit
RUN find /etc/runit -type f -exec chmod +x {} \;
CMD ["runsvdir", "/etc/runit"]