forked from linuxserver/docker-nextcloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
115 lines (110 loc) · 3.03 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
107
108
109
110
111
112
113
114
115
FROM lsiobase/nginx:3.12
# set version label
ARG BUILD_DATE
ARG VERSION
ARG NEXTCLOUD_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="aptalca"
# environment settings
ENV NEXTCLOUD_PATH="/config/www/nextcloud"
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies --upgrade \
autoconf \
automake \
file \
g++ \
gcc \
make \
php7-dev \
re2c \
samba-dev \
zlib-dev && \
echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \
curl \
ffmpeg \
fontconfig \
imagemagick \
libxml2 \
php7-apcu \
php7-bcmath \
php7-bz2 \
php7-ctype \
php7-curl \
php7-dom \
php7-exif \
php7-fileinfo \
php7-ftp \
php7-gd \
php7-gmp \
php7-iconv \
php7-imagick \
php7-imap \
php7-intl \
php7-ldap \
php7-mcrypt \
php7-memcached \
php7-opcache \
php7-pcntl \
php7-pdo_mysql \
php7-pdo_pgsql \
php7-pdo_sqlite \
php7-pgsql \
php7-phar \
php7-posix \
php7-redis \
php7-sodium \
php7-sqlite3 \
php7-xmlreader \
php7-zip \
samba-client \
sudo \
tar \
unzip && \
echo "**** compile smbclient ****" && \
git clone git://github.com/eduardok/libsmbclient-php.git /tmp/smbclient && \
cd /tmp/smbclient && \
phpize7 && \
./configure \
--with-php-config=/usr/bin/php-config7 && \
make && \
make install && \
echo "**** configure php and nginx for nextcloud ****" && \
echo "extension="smbclient.so"" > /etc/php7/conf.d/00_smbclient.ini && \
echo 'apc.enable_cli=1' >> /etc/php7/conf.d/apcu.ini && \
sed -i \
-e 's/;opcache.enable.*=.*/opcache.enable=1/g' \
-e 's/;opcache.interned_strings_buffer.*=.*/opcache.interned_strings_buffer=8/g' \
-e 's/;opcache.max_accelerated_files.*=.*/opcache.max_accelerated_files=10000/g' \
-e 's/;opcache.memory_consumption.*=.*/opcache.memory_consumption=128/g' \
-e 's/;opcache.save_comments.*=.*/opcache.save_comments=1/g' \
-e 's/;opcache.revalidate_freq.*=.*/opcache.revalidate_freq=1/g' \
-e 's/;always_populate_raw_post_data.*=.*/always_populate_raw_post_data=-1/g' \
-e 's/memory_limit.*=.*128M/memory_limit=512M/g' \
-e 's/max_execution_time.*=.*30/max_execution_time=120/g' \
-e 's/upload_max_filesize.*=.*2M/upload_max_filesize=1024M/g' \
-e 's/post_max_size.*=.*8M/post_max_size=1024M/g' \
/etc/php7/php.ini && \
sed -i \
'/opcache.enable=1/a opcache.enable_cli=1' \
/etc/php7/php.ini && \
echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php7/php-fpm.conf && \
echo "**** set version tag ****" && \
if [ -z ${NEXTCLOUD_RELEASE+x} ]; then \
NEXTCLOUD_RELEASE=$(curl -s https://raw.githubusercontent.com/nextcloud/nextcloud.com/master/strings.php \
| awk -F\' '/VERSIONS_SERVER_FULL_STABLE/ {print $2;exit}'); \
fi && \
echo "**** download nextcloud ****" && \
curl -o /app/nextcloud.tar.bz2 -L \
https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_RELEASE}.tar.bz2 && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
/tmp/*
# copy local files
COPY root/ /
# ports and volumes
EXPOSE 443
VOLUME /config /data