forked from linuxserver/docker-projectsend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
155 lines (149 loc) · 3.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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
FROM lsiobase/alpine:3.8
# set version label
ARG BUILD_DATE
ARG VERSION
ARG PROJECTSEND_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="sparklyballs"
# copy patches
COPY patches/ /tmp/patches/
# package versions
ARG APCU_VER="4.0.11"
ARG MEMCACHE_VER="3.0.8"
ARG XCACHE_VER="3.2.0"
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
autoconf \
automake \
bison \
file \
flex \
g++ \
gawk \
gcc \
make \
php5-dev \
zlib-dev && \
echo "**** install runtime packages ****" && \
apk add --no-cache \
apache2 \
apache2-utils \
curl \
php5-apache2 \
php5-bcmath \
php5-bz2 \
php5-cli \
php5-ctype \
php5-curl \
php5-dom \
php5-gd \
php5-gettext \
php5-gmp \
php5-iconv \
php5-json \
php5-mcrypt \
php5-mssql \
php5-mysql \
php5-odbc \
php5-openssl \
php5-pdo \
php5-pdo_dblib \
php5-pdo_mysql \
php5-pdo_odbc \
php5-phar \
php5-soap \
php5-xmlreader \
php5-xmlrpc \
php5-zip \
re2c \
tar \
wget && \
echo "**** configure php and apache2 ****" && \
ln -sf /usr/bin/php5 /usr/bin/php && \
sed -i \
-e 's#User apache#User abc#g' \
-e 's#Group apache#Group abc#g' \
-e 's#AllowOverride none#AllowOverride All#' \
-e 's/#LoadModule\ rewrite_module/LoadModule\ rewrite_module/' \
/etc/apache2/httpd.conf && \
sed -i 's#PidFile "/run/.*#Pidfile "/var/run/apache2/httpd.pid"#g' /etc/apache2/conf.d/mpm.conf && \
echo "**** compile php modules ****" && \
mkdir -p \
/tmp/apcu-src && \
curl -o \
/tmp/apcu.tgz -L \
"http://pecl.php.net/get/apcu-${APCU_VER}.tgz" && \
tar xf \
/tmp/apcu.tgz -C \
/tmp/apcu-src --strip-components=1 && \
cd /tmp/apcu-src && \
phpize5 && \
./configure \
--prefix=/usr \
--with-php-config=/usr/bin/php-config5 && \
make && \
make install && \
echo "extension=apcu.so" > /etc/php5/conf.d/apcu.ini && \
mkdir -p \
/tmp/memcache-src && \
curl -o \
/tmp/memcache.tgz -L \
"http://pecl.php.net/get/memcache-${MEMCACHE_VER}.tgz" && \
tar xf \
/tmp/memcache.tgz -C \
/tmp/memcache-src --strip-components=1 && \
cd /tmp/memcache-src && \
patch -p1 -i /tmp/patches/memcache-faulty-inline.patch && \
phpize5 && \
./configure \
--prefix=/usr \
--with-php-config=/usr/bin/php-config5 && \
make && \
make install && \
echo "extension=memcache.so" > /etc/php5/conf.d/memcache.ini && \
mkdir -p \
/tmp/xcache-src && \
curl -o \
/tmp/xcache.tar.gz -L \
"http://xcache.lighttpd.net/pub/Releases/${XCACHE_VER}/xcache-${XCACHE_VER}.tar.gz" && \
tar xf \
/tmp/xcache.tar.gz -C \
/tmp/xcache-src --strip-components=1 && \
cd /tmp/xcache-src && \
phpize5 --clean && \
phpize5 && \
./configure \
--enable-xcache \
--enable-xcache-constant \
--enable-xcache-coverager \
--enable-xcache-optimizer \
--prefix=/usr \
--with-php-config=/usr/bin/php-config5 && \
make && \
make install && \
install -Dm644 /tmp/patches/xcache.ini /etc/php5/conf.d/xcache.ini && \
echo "**** install projectsend ****" && \
rm /var/www/localhost/htdocs/index.html && \
if [ -z ${PROJECTSEND_RELEASE+x} ]; then \
PROJECTSEND_RELEASE=$(curl -sX GET "https://api.github.com/repos/projectsend/projectsend/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/ProjectSend.tar.gz -L \
"https://github.com/projectsend/projectsend/archive/${PROJECTSEND_RELEASE}.tar.gz" && \
tar -zxf \
/tmp/ProjectSend.tar.gz --strip-components=1 -C /var/www/localhost/htdocs/ && \
mv /var/www/localhost/htdocs/upload /defaults/ && \
mv /var/www/localhost/htdocs/img/custom /defaults/ && \
#cp /var/www/localhost/htdocs/includes/sys.config.sample.php /defaults/sys.config.php && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
/tmp/*
# add local files
COPY root/ /
# ports and volumes
EXPOSE 80
VOLUME /config /data