docker-scripts/linux/ecosystem/testrail/latest/Dockerfile

97 lines
3.6 KiB
Docker
Raw Normal View History

2021-04-01 13:43:06 +03:00
FROM epicmorg/apache2:php7.4
2020-07-30 17:52:12 +03:00
2022-08-16 16:42:00 +03:00
ARG PHP_MODULE_PATH=/usr/lib/php/20190902
ARG PHP_VER=7.4
ARG PHP_DIR=/etc/php/${PHP_VER}
ARG CAS_PHP_INI=${PHP_DIR}/mods-available/cassandra.ini
##############################################################################
# Cassandra CPP Support Install
##############################################################################
##############################################################################
# Cassandra PHP Drivers Install
##############################################################################
COPY addons/cassandra-php-driver /tmp/cassandra-php-driver
RUN cd /tmp/cassandra-php-driver && \
dpkg -i ./multiarch-support_2.28-10+deb10u1_amd64.deb && \
dpkg -i ./libuv1_1.35.0-1_amd64.deb && \
dpkg -i ./cassandra-cpp-driver_2.16.0-1_amd64.deb
COPY addons/Drivers.Cassandra/Linux/7.4/cassandra.so ${PHP_MODULE_PATH}
RUN echo "extension = ${PHP_MODULE_PATH}/cassandra.so" > ${CAS_PHP_INI} && \
ln -sf ${CAS_PHP_INI} ${PHP_DIR}/cgi/conf.d/cassandra.ini && \
ln -sf ${CAS_PHP_INI} ${PHP_DIR}/cli/conf.d/cassandra.ini && \
ln -sf ${CAS_PHP_INI} ${PHP_DIR}/fpm/conf.d/cassandra.ini && \
ln -sf ${CAS_PHP_INI} ${PHP_DIR}/apache2/conf.d/cassandra.ini && \
php -m && \
php -v
##############################################################################
# Testrail Install
##############################################################################
2022-01-25 19:28:57 +03:00
ENV TESTRAIL_VERSION=latest
ENV DOWNLOAD_URL=https://secure.gurock.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion72.zip
2022-01-25 20:29:02 +03:00
ENV TR_DEFAULT_TASK_EXECUTION=60
2022-01-25 19:28:57 +03:00
ENV TESTRAIL_RELEASE_DIR=/testrail-release
2020-07-30 17:52:12 +03:00
2022-01-25 20:29:02 +03:00
ENV TR_WWW_PATH=/var/www/testrail
2022-01-25 21:05:07 +03:00
ENV TR_CONFIGPATH=${TR_CONFIG_DIR}
2022-01-25 20:29:02 +03:00
ENV TR_CONFIG_DIR=${TR_WWW_PATH}/config
ENV TR_CUSTOM_DIR=${TR_WWW_PATH}/custom
ENV TR_CUSTOM_AUTH_DIR=${TR_CUSTOM_DIR}/auth
ENV TR_OPT_PATH=/opt/testrail
ENV TR_DEFAULT_LOG_DIR=${TR_OPT_PATH}/logs
ENV TR_DEFAULT_AUDIT_DIR=${TR_OPT_PATH}/audit
ENV TR_DEFAULT_REPORT_DIR=${TR_OPT_PATH}/reports
ENV TR_DEFAULT_ATTACHMENT_DIR=${TR_OPT_PATH}/attachments
2022-01-25 21:05:07 +03:00
ENV TR_OPTPATH="/opt/testrail/"
ENV TR_CONFIGPATH="/var/www/testrail/config/"
2020-07-30 17:52:12 +03:00
ENV OPENSSL_CONF=/etc/ssl/
RUN \
apt-get update && \
apt-get install -y --no-install-recommends zlib1g-dev libcurl4-gnutls-dev libldap2-dev zlib1g-dev libxml2-dev libfontconfig1 && \
apt-get clean && \
2022-01-25 21:42:26 +03:00
echo "ServerName localhost" >> /etc/apache2/apache2.conf && \
2020-07-30 17:52:12 +03:00
rm -rf /var/lib/apt/lists/* && \
2022-08-16 16:42:00 +03:00
rm -rf /run.sh && \
rm -rf /tmp/*
2020-07-30 17:52:12 +03:00
RUN \
2022-01-25 20:29:02 +03:00
echo "[testrail] Preparing folders" && \
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
mkdir -p ${TR_WWW_PATH} && \
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
echo "[testrail] Downloading and installing" && \
2022-01-25 19:28:57 +03:00
wget --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
2022-01-25 21:42:26 +03:00
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
2022-01-25 20:29:02 +03:00
chown -R www-data:www-data ${TR_WWW_PATH} && \
2022-01-25 21:05:07 +03:00
ls -las ${TR_WWW_PATH} && \
chown -R www-data:www-data ${TR_OPT_PATH} && \
ls -las ${TR_OPT_PATH}
2020-07-30 17:52:12 +03:00
2022-01-25 19:28:57 +03:00
COPY apache_testrail.conf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf
2020-07-30 17:52:12 +03:00
2022-03-21 18:36:40 +03:00
#healthcheck. good practice
HEALTHCHECK --interval=2m --timeout=3s CMD curl -f http://localhost:80/ || exit 1
# Add image configuration and scripts
COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh
RUN chmod 755 /usr/bin/docker-entrypoint.sh
#Final config
2020-07-30 17:52:12 +03:00
WORKDIR /var/www/testrail
2022-03-21 18:36:40 +03:00
EXPOSE 80 443
2020-07-30 17:52:12 +03:00
2022-03-21 18:36:40 +03:00
ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"]
CMD ["docker-entrypoint.sh"]