forked from cachethq/Docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
93 lines (80 loc) · 2.86 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
81
82
83
84
85
86
87
88
89
90
91
92
93
FROM nginx:1.13.9-alpine
MAINTAINER Alt Three <support@alt-three.com>
EXPOSE 8000
CMD ["/sbin/entrypoint.sh"]
ARG cachet_ver
ENV cachet_ver ${cachet_ver:-master}
ENV COMPOSER_VERSION 1.6.3
RUN apk add --no-cache --update \
postgresql-client \
postgresql \
mysql-client \
php7 \
php7-redis \
php7-apcu \
php7-bcmath \
php7-dom \
php7-ctype \
php7-curl \
php7-fpm \
php7-gd \
php7-iconv \
php7-intl \
php7-json \
php7-mbstring \
php7-mcrypt \
php7-mysqlnd \
php7-opcache \
php7-openssl \
php7-pdo \
php7-pdo_mysql \
php7-pdo_pgsql \
php7-pdo_sqlite \
php7-phar \
php7-posix \
php7-session \
php7-soap \
php7-xml \
php7-zip \
php7-zlib \
php7-tokenizer \
wget sqlite git curl bash grep \
supervisor
# 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 && \
ln -sf /dev/stdout /var/log/php7/error.log && \
ln -sf /dev/stderr /var/log/php7/error.log
RUN adduser -S -s /bin/bash -u 1001 -G root www-data
RUN touch /var/run/nginx.pid && \
chown -R www-data:root /var/run/nginx.pid /etc/php7/php-fpm.d
RUN mkdir -p /var/www/html && \
mkdir -p /usr/share/nginx/cache && \
mkdir -p /var/cache/nginx && \
mkdir -p /var/lib/nginx && \
chown -R www-data:root /var/www /usr/share/nginx/cache /var/cache/nginx /var/lib/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 1001
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:root /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/php7/php-fpm.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
USER root
RUN chmod g+rwx /var/run/nginx.pid && \
chmod -R g+rw /var/www /usr/share/nginx/cache /var/cache/nginx /var/lib/nginx/ /etc/php7/php-fpm.d storage
USER 1001