mantisbt-docker/Dockerfile

57 lines
2.4 KiB
Docker
Raw Normal View History

2020-05-17 16:14:40 +02:00
FROM php:7.4-apache
2020-05-17 17:37:31 +02:00
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
2020-05-17 16:14:40 +02:00
2020-05-17 17:37:31 +02:00
# hadolint ignore=DL3008
2020-05-17 16:14:40 +02:00
RUN set -xe \
&& apt-get update \
2020-05-17 17:37:31 +02:00
&& apt-get install --no-install-recommends -y \
2020-05-17 16:14:40 +02:00
# PHP dependencies
libfreetype6-dev libpng-dev libjpeg-dev libpq-dev libxml2-dev \
# New in PHP 7.4, required for mbstring, see https://github.com/docker-library/php/issues/880
libonig-dev \
&& docker-php-ext-configure gd --with-jpeg --with-freetype \
&& docker-php-ext-install gd mbstring mysqli soap \
2020-05-17 17:37:31 +02:00
&& rm -rf /var/lib/apt/lists/* \
&& a2enmod rewrite
2020-05-17 16:14:40 +02:00
2021-01-22 20:39:52 +01:00
ENV MANTIS_VER 2.24.4
ENV MANTIS_MD5 c557b1203368c7427b92177de4ce7285
2020-05-17 16:14:40 +02:00
ENV MANTIS_URL https://sourceforge.net/projects/mantisbt/files/mantis-stable/${MANTIS_VER}/mantisbt-${MANTIS_VER}.tar.gz
ENV MANTIS_FILE mantisbt.tar.gz
# Install MantisBT itself
RUN set -xe \
2020-05-17 17:37:31 +02:00
&& curl -fSL "${MANTIS_URL}" -o "${MANTIS_FILE}" \
&& md5sum "${MANTIS_FILE}" \
2020-05-17 16:14:40 +02:00
&& echo "${MANTIS_MD5} ${MANTIS_FILE}" | md5sum -c \
2020-05-17 17:37:31 +02:00
&& tar -xz --strip-components=1 -f "${MANTIS_FILE}" \
&& rm "${MANTIS_FILE}" \
2020-05-17 16:14:40 +02:00
&& rm -r doc \
&& chown -R www-data:www-data . \
# Apply PHP and config fixes
# Use the default production configuration
&& mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
2020-05-17 17:37:31 +02:00
&& echo 'mysqli.allow_local_infile = Off' >> "$PHP_INI_DIR/conf.d/mantis.php.ini" \
&& echo 'display_errors = Off ' >> "$PHP_INI_DIR/conf.d/mantis.php.ini" \
&& echo 'log_errors = On ' >> "$PHP_INI_DIR/conf.d/mantis.php.ini" \
&& echo 'error_log = /dev/stderr' >> "$PHP_INI_DIR/conf.d/mantis.php.ini" \
&& echo 'upload_max_filesize = 50M ' >> "$PHP_INI_DIR/conf.d/mantis.php.ini" \
&& echo 'post_max_size = 51M ' >> "$PHP_INI_DIR/conf.d/mantis.php.ini" \
2020-05-17 17:37:31 +02:00
&& echo 'register_argc_argv = Off' >> "$PHP_INI_DIR/conf.d/mantis.php.ini"
2020-05-17 16:14:40 +02:00
COPY config_inc.php /var/www/html/config/config_inc.php
# Install additional plugins
2021-01-22 20:56:24 +01:00
ENV SOURCE_TAG v2.4.1
2020-05-17 16:14:40 +02:00
RUN set -xe && \
2020-05-17 17:37:31 +02:00
curl -fSL https://github.com/mantisbt-plugins/source-integration/tarball/${SOURCE_TAG} -o /tmp/source.tar.gz && \
mkdir /tmp/source && \
tar -xz --strip-components=1 -f /tmp/source.tar.gz -C /tmp/source/ && \
2020-05-17 16:14:40 +02:00
cp -r /tmp/source/Source /tmp/source/SourceGitlab /tmp/source/SourceGithub /var/www/html/plugins/ && \
rm -r /tmp/source
2020-05-17 17:37:31 +02:00
COPY ./mantis-entrypoint /usr/local/bin/mantis-entrypoint
2020-05-17 16:14:40 +02:00
CMD ["mantis-entrypoint"]