forked from cachethq/Docker
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
106 lines (90 loc) · 3.06 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
94
95
96
97
98
99
100
101
102
103
104
105
106
FROM nginx:1.17.10-alpine
EXPOSE 8000
CMD ["/sbin/entrypoint.sh"]
ARG cachet_ver
ARG archive_url
ENV cachet_ver ${cachet_ver:-2.5}
ENV archive_url ${archive_url:-https://github.com/fiveai/Cachet/archive/${cachet_ver}.tar.gz}
ENV COMPOSER_VERSION 1.9.0
RUN apk add --no-cache --update \
mysql-client \
php7 \
php7-apcu \
php7-bcmath \
php7-ctype \
php7-curl \
php7-dom \
php7-fileinfo \
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-redis \
php7-session \
php7-simplexml \
php7-soap \
php7-sqlite3 \
php7-tokenizer \
php7-xml \
php7-xmlwriter \
php7-zip \
php7-zlib \
postfix \
postgresql \
postgresql-client \
sqlite \
sudo \
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 echo "www-data ALL=(ALL:ALL) NOPASSWD:SETENV: /usr/sbin/postfix" >> /etc/sudoers
RUN touch /var/run/nginx.pid && \
chown -R www-data:root /var/run/nginx.pid
RUN chown -R www-data:root /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 wget https://getcomposer.org/installer -O /tmp/composer-setup.php && \
wget https://composer.github.io/installer.sig -O /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 ${archive_url} && \
tar xzf ${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 -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