21 lines
742 B
Docker
21 lines
742 B
Docker
FROM matomo:5.14.2-apache
|
|
|
|
RUN a2enmod rewrite && \
|
|
apt-get update && apt-get install -y --no-install-recommends libcap2-bin && \
|
|
chown -R www-data:www-data /var/log/apache2 /var/www/html && \
|
|
setcap 'cap_net_bind_service=+ep' /usr/sbin/apache2 && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
ARG USER=www-data
|
|
USER ${USER}
|
|
|
|
COPY --chown=${USER}:${USER} ./config/config.ini.php /var/www/html/config/config.ini.php
|
|
|
|
RUN printf "Options +FollowSymLinks\n\
|
|
RewriteEngine On\n\
|
|
# Block sensitive dirs\n\
|
|
RewriteRule ^\.git(/|$) - [F,L]\n\
|
|
RewriteRule ^(core|config|lang|tmp)(/|$) - [F,L]\n\
|
|
# Existing rules\n\
|
|
RewriteRule ^unicorn$ matomo.js [L]\n\
|
|
RewriteRule ^rainbow$ matomo.php [L]\n" > /var/www/html/.htaccess
|