-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
98 lines (91 loc) · 3.86 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
FROM arm64v8/php:7.4.18-apache
ENV FR_DB_HOST=db \
FR_DB_PORT=3306 \
FR_DB_NAME=filerun \
FR_DB_USER=filerun \
FR_DB_PASS=filerun \
APACHE_RUN_USER=user \
APACHE_RUN_USER_ID=1000 \
APACHE_RUN_GROUP=user \
APACHE_RUN_GROUP_ID=1000
VOLUME ["/var/www/html", "/user-files"]
# set recommended PHP.ini settings
# see http://docs.filerun.com/php_configuration
COPY filerun-optimization.ini /usr/local/etc/php/conf.d/
COPY autoconfig.php entrypoint.sh wait-for-it.sh import-db.sh filerun.setup.sql supervisord.conf /
#freetype patch
#ADD https://git.archlinux.org/svntogit/packages.git/plain/trunk/freetype.patch?h=packages/php /tmp/freetype.patch
# add PHP, extensions and third-party software
RUN apt-get update \
&& apt-get install -y \
libapache2-mod-xsendfile \
libfreetype6-dev \
libjpeg62-turbo-dev \
libldap2-dev \
libxml2-dev \
libzip-dev \
libcurl4-gnutls-dev \
dcraw \
locales \
graphicsmagick \
ffmpeg \
#default-mysql-client \
unzip \
cron \
libtiff-dev \
libwebp-dev \
libosmesa6-dev \
libgl1 \
ufraw \
mariadb-client \
vim \
supervisor \
# patch PHP freetype
#&& docker-php-source extract; \
# cd /usr/src/php; \
# patch -p1 -i /tmp/freetype.patch; \
# rm /tmp/freetype.patch \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /var/log/supervisord /var/run/supervisord \
#&& sed -i '/disable ghostscript format types/,+6d' /etc/ImageMagick-6/policy.xml \
# the above /etc/ImageMagick-6/policy.xml file doesn't exist, I read that graphicsmagick doesn't use a policy.xml file but you can do similar things with env vars (https://stackoverflow.com/questions/50825595/equivalent-of-policy-xml-file-with-graphicsmagick-to-deal-with-pixel-flood-dos-a)
&& docker-php-ext-configure zip \
#&& docker-php-ext-configure gd --with-gd --with-freetype-dir \
&& docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
# && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu \
&& docker-php-ext-configure ldap \
&& docker-php-ext-install -j$(nproc) pdo_mysql exif zip gd opcache ldap \
&& a2enmod rewrite \
# Install ionCube for arm64 (aarch64)
&& echo [Install ionCube] \
&& curl -O -L https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64.tar.gz \
&& tar xvfz ioncube_loaders_lin_aarch64.tar.gz ioncube/ioncube_loader_lin_7.4.so \
&& PHP_EXT_DIR=$(php-config --extension-dir) \
&& cp "ioncube/ioncube_loader_lin_7.4.so" $PHP_EXT_DIR \
&& echo "zend_extension=ioncube_loader_lin_7.4.so" >> /usr/local/etc/php/conf.d/00_ioncube_loader_lin_7.4.ini \
&& rm -rf ioncube ioncube_loaders_lin_aarch64.tar.gz \
# Install STL-THUMB
&& echo [Install STL-THUMB] \
&& curl -O -L https://github.com/unlimitedbacon/stl-thumb/releases/download/v0.4.0/stl-thumb_0.4.0_arm64.deb \
&& dpkg -i stl-thumb_0.4.0_arm64.deb \
&& rm -rf stl-thumb_0.4.0_arm64.deb \
# Enable Apache XSendfile
&& echo [Enable Apache XSendfile] \
&& echo "XSendFile On\nXSendFilePath /user-files" | tee "/etc/apache2/conf-available/filerun.conf" \
&& a2enconf filerun \
# Enable Apache XSendfile
#RUN { \
# echo 'XSendFile On'; \
# echo; \
# echo 'XSendFilePath /user-files'; \
# } | tee "/etc/apache2/conf-available/filerun.conf" \
# && a2enconf filerun
# Download FileRun installation package
&& echo [Download FileRun installation package version 2021.03.26 \
&& curl -o /filerun.zip -L 'https://f.afian.se/wl/?id=SkPwYC8dOcMIDWohmyjOqAgdqhRqCZ3X&fmode=download' \
&& chown www-data:www-data /user-files \
&& chmod +x /wait-for-it.sh /import-db.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
#CMD ["apache2-foreground"]
CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]