-
Notifications
You must be signed in to change notification settings - Fork 281
/
Copy pathDockerfile
77 lines (62 loc) · 3.12 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
FROM debian:jessie
MAINTAINER Alt Three <[email protected]>
EXPOSE 8000
CMD ["/sbin/entrypoint.sh"]
ARG cachet_ver
ENV cachet_ver ${cachet_ver:-v2.3.11}
ENV PG_MAJOR 9.5
ENV NGINX_VERSION 1.12.0-1~jessie
ENV COMPOSER_VERSION 1.4.1
RUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62
RUN echo "deb http://nginx.org/packages/debian/ jessie nginx" > /etc/apt/sources.list.d/nginx.list
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main" $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list
# Using debian packages instead of compiling from scratch
RUN DEBIAN_FRONTEND=noninteractive \
echo "APT::Install-Recommends \"0\";" >> /etc/apt/apt.conf.d/02recommends && \
echo "APT::Install-Suggests \"0\";" >> /etc/apt/apt.conf.d/02recommends && \
apt-get clean && \
apt-get -q -y update && \
apt-get -q -y install \
ca-certificates \
postgresql-client-$PG_MAJOR \
mysql-client \
nginx=${NGINX_VERSION} \
php5-fpm php5-curl \
php5-readline php5-mcrypt sudo \
php5-apcu php5-cli php5-gd \
php5-mysql php5-pgsql php5-sqlite \
wget sqlite libsqlite3-dev git \
supervisor && \
apt-get clean && apt-get autoremove -q && \
rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man /tmp/*
# 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
RUN touch /var/run/nginx.pid /var/run/php5-fpm.pid && \
chown -R www-data:www-data /var/run/nginx.pid /var/run/php5-fpm.pid
RUN adduser www-data sudo && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN mkdir -p /var/www/html /usr/share/nginx/cache && \
chown -R www-data:www-data /var/www /usr/share/nginx/cache /var/cache/nginx
# Install composer
RUN php -r "copy('https://getcomposer.org/installer', '/tmp/composer-setup.php');" && \
php -r "copy('https://composer.github.io/installer.sig', '/tmp/composer-setup.sig');" && \
php -r "if (hash('SHA384', file_get_contents('/tmp/composer-setup.php')) !== trim(file_get_contents('/tmp/composer-setup.sig'))) { unlink('/tmp/composer-setup.php'); echo 'Invalid installer' . PHP_EOL; exit(1); }" && \
php /tmp/composer-setup.php --version=$COMPOSER_VERSION --install-dir=bin && \
php -r "unlink('/tmp/composer-setup.php');"
WORKDIR /var/www/html/
USER www-data
RUN wget https://github.com/cachethq/Cachet/archive/${cachet_ver}.tar.gz && \
tar xzvf ${cachet_ver}.tar.gz --strip-components=1 && \
chown -R www-data /var/www/html && \
rm -r ${cachet_ver}.tar.gz && \
php /bin/composer.phar global require "hirak/prestissimo:^0.3" && \
php /bin/composer.phar install --no-dev -o && \
rm -rf bootstrap/cache/*
COPY conf/php-fpm-pool.conf /etc/php5/fpm/pool.d/www.conf
COPY conf/supervisord.conf /etc/supervisor/supervisord.conf
COPY conf/nginx.conf /etc/nginx/nginx.conf
COPY conf/nginx-site.conf /etc/nginx/conf.d/default.conf
COPY conf/.env.docker /var/www/html/.env
COPY entrypoint.sh /sbin/entrypoint.sh