blob: 122df7dcc3db016f414054eb425de9f64bee855b [file] [log] [blame]
Matthias Andreas Benkardaa404642019-12-31 13:23:47 +01001FROM tikiwiki/php:7.2-apache
2LABEL mantainer "TikiWiki <tikiwiki-devel@lists.sourceforge.net>"
3
4ARG TIKI_SOURCE="https://gitlab.com/tikiwiki/tiki/-/archive/master/tiki-master.tar.gz"
5WORKDIR "/var/www/html"
6
7# If you have https_proxy with SslBump, place it's cetificate
8# in this variable to have curl and composer content cached
9ARG HTTPS_PROXY_CERT=""
10
11RUN echo "${HTTPS_PROXY_CERT}" > /usr/local/share/ca-certificates/https_proxy.crt \
12 && update-ca-certificates \
13 && curl -o tiki.tar.gz -L "${TIKI_SOURCE}" \
14 && chown root: /var/www/html \
15 && tar -C /var/www/html --no-same-owner -zxf tiki.tar.gz --strip 1 \
16 && composer global require hirak/prestissimo \
17 && composer install --working-dir /var/www/html/vendor_bundled --prefer-dist \
18 && rm tiki.tar.gz \
19 && rm -rf /var/lib/apt/lists/* \
20 && rm -rf /tmp/* \
21 && rm -rf /root/.composer \
22 && { \
23 echo "<?php"; \
24 echo " \$db_tiki = getenv('TIKI_DB_DRIVER') ?: 'mysqli';"; \
25 echo " \$dbversion_tiki = getenv('TIKI_DB_VERSION') ?: '21';"; \
26 echo " \$host_tiki = getenv('TIKI_DB_HOST') ?: 'db';"; \
27 echo " \$user_tiki = getenv('TIKI_DB_USER');"; \
28 echo " \$pass_tiki = getenv('TIKI_DB_PASS');"; \
29 echo " \$dbs_tiki = getenv('TIKI_DB_NAME') ?: 'tikiwiki';"; \
30 echo " \$client_charset = 'utf8mb4';"; \
31 } > /var/www/html/db/local.php \
32 && {\
33 echo "session.save_path=/var/www/sessions"; \
34 } > /usr/local/etc/php/conf.d/tiki_session.ini \
35 && /bin/bash htaccess.sh \
36 && mkdir -p /var/www/sessions \
37 && chown -R www-data /var/www/sessions \
38 && chown -R www-data /var/www/html/db/ \
39 && chown -R www-data /var/www/html/dump/ \
40 && chown -R www-data /var/www/html/img/trackers/ \
41 && chown -R www-data /var/www/html/img/wiki/ \
42 && chown -R www-data /var/www/html/img/wiki_up/ \
43 && chown -R www-data /var/www/html/modules/cache/ \
44 && chown -R www-data /var/www/html/temp/ \
45 && chown -R www-data /var/www/html/templates/
46
47VOLUME ["/var/www/html/files/","/var/www/html/img/trackers/","/var/www/html/img/wiki_up/","/var/www/html/img/wiki/","/var/www/html/modules/cache/","/var/www/html/storage/","/var/www/html/temp/","/var/www/sessions/"]
48EXPOSE 80
49CMD ["apache2-foreground"]