forked from passbolt/passbolt_docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
86 lines (74 loc) · 2.79 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
FROM php:7-fpm
LABEL maintainer="[email protected]"
ARG PASSBOLT_VERSION="2.0.5"
ARG PASSBOLT_URL="https://github.com/passbolt/passbolt_api/archive/v${PASSBOLT_VERSION}.tar.gz"
ARG PHP_EXTENSIONS="gd \
intl \
pdo_mysql \
xsl"
ARG PHP_EXTENSIONS="gd \
intl \
pdo_mysql \
xsl"
ARG PECL_PASSBOLT_EXTENSIONS="gnupg \
redis \
mcrypt"
ARG PASSBOLT_DEV_PACKAGES="libgpgme11-dev \
libpng-dev \
libjpeg62-turbo-dev \
libicu-dev \
libxslt1-dev \
libmcrypt-dev \
unzip \
git"
ENV PECL_BASE_URL="https://pecl.php.net/get"
ENV PHP_EXT_DIR="/usr/src/php/ext"
WORKDIR /var/www/passbolt
RUN apt-get update \
&& apt-get -y install --no-install-recommends $PASSBOLT_DEV_PACKAGES \
nginx \
gnupg \
libgpgme11 \
libmcrypt4 \
mysql-client \
supervisor \
netcat \
cron \
&& mkdir /home/www-data \
&& chown -R www-data:www-data /home/www-data \
&& usermod -d /home/www-data www-data \
&& docker-php-source extract \
&& for i in $PECL_PASSBOLT_EXTENSIONS; do \
mkdir $PHP_EXT_DIR/$i; \
curl -sSL $PECL_BASE_URL/$i | tar zxf - -C $PHP_EXT_DIR/$i --strip-components 1; \
done \
&& docker-php-ext-configure gd --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j4 $PHP_EXTENSIONS $PECL_PASSBOLT_EXTENSIONS \
&& docker-php-ext-enable $PHP_EXTENSIONS $PECL_PASSBOLT_EXTENSIONS \
&& docker-php-source delete \
&& EXPECTED_SIGNATURE=$(curl -s https://composer.github.io/installer.sig) \
&& curl -o composer-setup.php https://getcomposer.org/installer \
&& ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');") \
&& if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then \
>&2 echo 'ERROR: Invalid installer signature'; \
rm composer-setup.php; \
exit 1; \
fi \
&& php composer-setup.php \
&& mv composer.phar /usr/local/bin/composer \
&& curl -sSL $PASSBOLT_URL | tar zxf - -C . --strip-components 1 \
&& composer install -n --no-dev --optimize-autoloader \
&& chown -R www-data:www-data . \
&& chmod 775 $(find /var/www/passbolt/tmp -type d) \
&& chmod 664 $(find /var/www/passbolt/tmp -type f) \
&& chmod 775 $(find /var/www/passbolt/webroot/img/public -type d) \
&& chmod 664 $(find /var/www/passbolt/webroot/img/public -type f) \
&& rm /etc/nginx/sites-enabled/default \
&& apt-get purge -y --auto-remove $PASSBOLT_DEV_PACKAGES \
&& rm -rf /var/lib/apt/lists/* \
&& rm /usr/local/bin/composer
COPY conf/passbolt.conf /etc/nginx/conf.d/default.conf
COPY conf/supervisord.conf /etc/supervisor/supervisord.conf
COPY bin/docker-entrypoint.sh /docker-entrypoint.sh
EXPOSE 80 443
CMD ["/docker-entrypoint.sh"]