-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
59 lines (42 loc) · 1.58 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
FROM php:7.1.27-fpm-stretch
LABEL maintainer="Abed Halawi <[email protected]>"
ENV php_conf /usr/local/etc/php/php.ini
ENV fpm_conf /usr/local/etc/php/php-fpm.conf
ENV fpm_conf_dir /usr/local/etc/php-fpm.d/
RUN apt-get update \
&& apt-get install -y autoconf pkg-config libssl-dev
RUN docker-php-ext-install bcmath
RUN docker-php-ext-install sockets
RUN pecl install mongodb-1.2.2 \
&& docker-php-ext-enable mongodb
RUN apt-get update \
&& apt-get install -y libpq-dev \
&& docker-php-ext-install pdo pdo_pgsql
RUN apt-get update \
&& apt-get install -y libzip-dev zip \
&& docker-php-ext-configure zip --with-libzip \
&& docker-php-ext-install zip pcntl
RUN apt-get update \
&& apt-get install -y nginx supervisor cron
RUN mkdir /code
RUN useradd --no-create-home nginx
# tweak php-fpm config
COPY php/php.ini ${php_conf}
COPY php/www.conf.default ${fpm_conf_dir}/www.conf
COPY php/pools/pool-1.conf ${fpm_conf_dir}/pool-1.conf
COPY php/pools/pool-2.conf ${fpm_conf_dir}/pool-2.conf
COPY php/pools/pool-3.conf ${fpm_conf_dir}/pool-3.conf
COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY nginx/php.conf /etc/nginx/php.conf
COPY nginx/host.conf /etc/nginx/conf.d/default.conf
# add cron runner script
COPY cron.sh /cron.sh
COPY supervisord.conf /etc/supervisor/supervisord.conf
# install cronitor cli
WORKDIR /tmp
RUN curl -sOL https://cronitor.io/dl/cronitor-stable-linux-amd64.tgz
RUN tar xvf cronitor-stable-linux-amd64.tgz -C /usr/bin/
RUN rm cronitor-stable-linux-amd64.tgz
WORKDIR /code
EXPOSE 443 80
CMD /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf