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