forked from docker-library/owncloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.template
62 lines (55 loc) · 2.35 KB
/
Dockerfile.template
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
# https://owncloud.com/minimum-product-requirements/ ("5.6 recommended")
# https://doc.owncloud.org/server/10.0/admin_manual/installation/system_requirements.html ("PHP (5.6+ or 7.0+)")
# https://doc.owncloud.org/server/9.0/admin_manual/installation/system_requirements.html ("PHP 7.0")
FROM php:7.0-%%VARIANT%%
RUN apt-get update && apt-get install -y --no-install-recommends \
bzip2 \
libcurl4-openssl-dev \
libfreetype6-dev \
libicu-dev \
libjpeg-dev \
libldap2-dev \
libmcrypt-dev \
libmemcached-dev \
libpng12-dev \
libpq-dev \
libxml2-dev \
&& rm -rf /var/lib/apt/lists/*
# https://doc.owncloud.org/server/8.1/admin_manual/installation/source_installation.html#prerequisites
RUN docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
&& docker-php-ext-install exif gd intl ldap mbstring mcrypt opcache pdo pdo_mysql pdo_pgsql pgsql zip
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=60'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
RUN a2enmod rewrite
# PECL extensions
RUN set -ex \
&& pecl install APCu-5.1.8 \
&& pecl install memcached-3.0.3 \
&& pecl install redis-3.1.2 \
&& docker-php-ext-enable apcu memcached redis
ENV OWNCLOUD_VERSION %%VERSION%%
VOLUME /var/www/html
RUN curl -fsSL -o owncloud.tar.bz2 \
"https://download.owncloud.org/community/owncloud-${OWNCLOUD_VERSION}.tar.bz2" \
&& curl -fsSL -o owncloud.tar.bz2.asc \
"https://download.owncloud.org/community/owncloud-${OWNCLOUD_VERSION}.tar.bz2.asc" \
&& export GNUPGHOME="$(mktemp -d)" \
# gpg key from https://owncloud.org/owncloud.asc
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys E3036906AD9F30807351FAC32D5D5E97F6978A26 \
&& gpg --batch --verify owncloud.tar.bz2.asc owncloud.tar.bz2 \
&& rm -r "$GNUPGHOME" owncloud.tar.bz2.asc \
&& tar -xjf owncloud.tar.bz2 -C /usr/src/ \
&& rm owncloud.tar.bz2
COPY docker-entrypoint.sh /usr/local/bin/
RUN ln -s usr/local/bin/docker-entrypoint.sh /entrypoint.sh # backwards compat
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["%%CMD%%"]