- Initial commit.

This commit is contained in:
Arnaud G. GIBERT 2025-03-12 23:11:09 +01:00
commit 2f3edf2a00
6 changed files with 362 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*~
*.old

68
Dockerfile Normal file
View File

@ -0,0 +1,68 @@
# Rx3-Docker/SquashTM Dockerfile
#-------------------------------------------------------------------------------
ARG IMG_FROM_URL="rx3-docker/java:latest"
FROM ${IMG_FROM_URL}
ARG IMG_NAME
ARG IMG_NAME_FULL
ARG IMG_VERSION
ARG IMG_MAINTAINER
LABEL org.rx3.${IMG_NAME}.name=${IMG_NAME_FULL}
LABEL org.rx3.${IMG_NAME}.version=${IMG_VERSION}
LABEL org.rx3.${IMG_NAME}.maintainer=${IMG_MAINTAINER}
LABEL maintainer=${IMG_MAINTAINER}
ARG SQUASHTM_HOME=/opt/appl/squashtm
ARG SQUASHTM_STARTUP=${SQUASHTM_HOME}/bin/startup.sh
#----------------------------------------------------------------------------------------------------------------------------------------------
ARG SQUASHTM='#!/bin/bash \n\
\n\
chown -R squashtm:squashtm '${SQUASHTM_HOME}' \n\
chmod -R u-x,g-x,o-rwx,u+X,g+X '${SQUASHTM_HOME}' \n\
\n\
sed -i "s%^DB_TYPE=h2%DB_TYPE=postgresql%" '${SQUASHTM_STARTUP}' \n\
sed -i "s%^DB_URL=\".*\"%DB_URL=\"jdbc:postgresql://${SQUASHTM_DB_HOST}:${SQUASHTM_DB_PORT}/${SQUASHTM_DB_NAME}\"%" '${SQUASHTM_STARTUP}' \n\
sed -i "s%^DB_USERNAME=sa%DB_USERNAME=${SQUASHTM_DB_USER}%" '${SQUASHTM_STARTUP}' \n\
sed -i "s%^DB_PASSWORD=sa%DB_PASSWORD=${SQUASHTM_DB_PASSWORD}%" '${SQUASHTM_STARTUP}' \n\
\n\
chmod a+x '${SQUASHTM_STARTUP}
#----------------------------------------------------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
ARG MODULED_INI='[program:squashtm] \n\
directory=/opt/appl/squashtm/bin \n\
command='${SQUASHTM_STARTUP}
#---------------------------------------------------------------------------------------------------
RUN urpmi.update -a \
&& urpmi --force wget \
&& mkdir /opt/appl \
&& useradd -M --home-dir ${SQUASHTM_HOME} --password "" squashtm \
&& wget -q -O - https://nexus.squashtest.org/nexus/repository/public-releases/tm/core/squash-tm-distribution/9.0.0.RELEASE/squash-tm-9.0.0.RELEASE.tar.gz | tar xzvf - -C /opt/appl \
&& mv /opt/appl/squash-tm ${SQUASHTM_HOME} \
&& mv ${SQUASHTM_HOME}/logs /var/log/squashtm \
&& ln -s /var/log/squashtm ${SQUASHTM_HOME}/logs \
&& mkdir ${SQUASHTM_HOME}/plugin-files/bugtracker.mantis \
&& wget -q -O - https://nexus.squashtest.org/nexus/repository/public-releases/tm/plugin/bugtracker/mantis/9.0.0.RELEASE/bugtracker.mantis-9.0.0.RELEASE.tar.gz | tar xzvf - -C ${SQUASHTM_HOME}/plugin-files/bugtracker.mantis \
&& echo -e "${SQUASHTM}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/squashtm \
&& chmod a+x /etc/init.d/squashtm \
&& ln -s /etc/init.d/squashtm /etc/rcD.d/S40squashtm \
&& echo -e "${MODULED_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/moduled.ini
#COPY ${MODULE_PATH}/target/${MODULE_NAME}-${MODULE_VERSION}.jar /opt/appl/${MODULE_NAME}
#COPY ${MODULE_PATH}/application.properties /opt/appl/${MODULE_NAME}
EXPOSE 8080

24
ReadMe.txt Normal file
View File

@ -0,0 +1,24 @@
Welcome to Rx3-Docker/SquashTM docker image!
This project aims to build a MantisBT docker image.
Features:
- Curtently based on rx3-docker/java-1.1.1-mga9 & rx3-docker/postgresql:1.1.1-mga9 images,
- Sync with SquashTM 9.0.0.
Note:
The following SQL have to been executed on mantisdb with postgres user:
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO mantisbt;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO mantisbt;
Enjoy it!
Your Rx3 Team.
--
arnaud@rx3.net
https://git.rx3.org/gitea/rx3-docker/mantisbt

21
ReleaseNotes.txt Normal file
View File

@ -0,0 +1,21 @@
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/MantisBT V 1.0.1 - A. GIBERT - 2025/03/08
------------------------------------------------------------------------------------------------------------------------------------
- Add default config in etc/mantisbt/config_inc.php.ref,
- Add MANTISBT_ADMIN_ENABLED env variable to disable admin directory access,
- Add var/www/mantisbt/images-local volume allowing logo addition,
- Add ssmtp program and SMTP_SERVER env variable to allow mail sending,
- Add php xmlreader & xmlwriter module tu support "Import/Export issues" plugin,
- Switch to docker_tools "mixed" volume mode,
- Now use rx3-docker/php-apache:1.5.2-mga9 & rx3-docker/postgresql:1.1.1-mga9 images,
- Set PHP_UPLOAD_LIMIT to 64M.
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/MantisBT V 1.0.0 - A. GIBERT - 2025/03/06
------------------------------------------------------------------------------------------------------------------------------------
- Initial release,
- Use based on rx3-docker/php-apache:1.4.0-mga9 & rx3-docker/postgresql:1.1.0-mga9 images.

112
compose.yaml Normal file
View File

@ -0,0 +1,112 @@
# Rx3-Docker/SquashTM Docker Image
#-------------------------------------------------------------------------------
name: ${HOST_NAME_PREFIX}
services:
database:
container_name: ${DB_HOST_NAME}
hostname: ${DB_HOST_NAME}
image: ${DB_IMG_URL}
restart: unless-stopped
environment:
POSTGRESQL_UID: ${DB_USER_ID}
POSTGRESQL_GID: ${DB_GROUP_ID}
POSTGRESQL_POSTGRES_PASSWORD: ${DB_POSTGRES_PASSWORD}
POSTGRESQL_DATABASE: ${DB_NAME}
POSTGRESQL_USER: ${DB_USER}
POSTGRESQL_PASSWORD: ${DB_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "sh -c 'pg_isready -U ${DB_USER} -d ${DB_NAME}'"]
interval: 10s
timeout: 3s
retries: 3
volumes:
- ./${DB_LIB_EXT}:${DB_LIB_INT}
- ./${DB_LOG_INIT_EXT}:${DB_LOG_INIT_INT}
- ./${DB_LOG_SV_EXT}:${DB_LOG_SV_INT}
- ./${DB_LOG_MAIN_EXT}:${DB_LOG_MAIN_INT}
networks:
- appl
# ports:
# - "127.0.0.1:${DB_PORT_SV_EXT}:${DB_PORT_SV_INT}"
# - "127.0.0.1:${DB_PORT_MAIN_EXT}:${DB_PORT_MAIN_INT}"
#-------------------------------------------------------------------------------
webapp:
container_name: ${WA_HOST_NAME}
hostname: ${WA_HOST_NAME}
image: ${WA_IMG_URL}
# image: squashtest/squash
build:
context: .
args:
IMG_NAME: ${WA_IMG_URL}
IMG_NAME_FULL: ${WA_IMG_NAME_FULL}
IMG_VERSION: ${WA_IMG_VERSION}
IMG_MAINTAINER: ${APPL_MAINTAINER}
IMG_FROM_URL: ${WA_IMG_FROM_URL}
restart: unless-stopped
depends_on:
database:
condition: service_healthy
environment:
SERVER_CROND_ENABLED: ${WA_CROND_ENABLED}
APACHE_UID: ${WA_USER_ID}
APACHE_GID: ${WA_GROUP_ID}
APACHE_DOC_ROOT: ${WA_APACHE_DOC_ROOT}
PHP_UPLOAD_LIMIT: ${WA_PHP_UPLOAD_LIMIT}
SQUASHTM_DB_NAME: ${DB_NAME}
SQUASHTM_DB_USER: ${DB_USER}
SQUASHTM_DB_PASSWORD: ${DB_PASSWORD}
SQUASHTM_DB_HOST: ${DB_HOST_NAME}
SQUASHTM_DB_PORT: ${DB_PORT_MAIN_INT}
volumes:
- ./${WA_LOG_INIT_EXT}:${WA_LOG_INIT_INT}
- ./${WA_LOG_SV_EXT}:${WA_LOG_SV_INT}
- ./${WA_LOG_MAIN_EXT}:${WA_LOG_MAIN_INT}
# - ./${WA_LOG_HTTPD_EXT}:${WA_LOG_HTTPD_INT}
# - ./${WA_CONF_EXT}:${WA_CONF_INT}
# - ./${WA_IMG_EXT}:${WA_IMG_INT}
networks:
- appl
# - internal
ports:
- "127.0.0.1:${WA_PORT_SV_EXT}:${WA_PORT_SV_INT}"
- "127.0.0.1:${WA_PORT_MAIN_EXT}:${WA_PORT_MAIN_INT}"
networks:
appl:
name: ${NETWORK_NAME}
driver: bridge
driver_opts:
com.docker.network.bridge.name: ${NETWORK_IF_NAME}
# ipam:
# config:
# - subnet: 10.2.33.0/24
# gateway: 10.2.33.254
# internal:
# name: mantisbt-squashtm-internal
# external: true

135
env.dist Normal file
View File

@ -0,0 +1,135 @@
# Rx3-Docker/MantisBT Docker Image
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Global Settings
#-------------------------------------------------------------------------------
ORG_NAME="rx3-docker"
ORG_REGISTRY="docker.xor.rx3:5000"
ORG_URL_PREFIX="${ORG_REGISTRY}/${ORG_NAME}"
#-------------------------------------------------------------------------------
# Image Settings
#-------------------------------------------------------------------------------
APPL_NAME="squash-tm"
APPL_NAME_FULL="Squash Test Manager"
APPL_NAME_SHORT="squashtm"
APPL_ORG="rx3-docker"
APPL_VERSION="1.0.0"
APPL_MAINTAINER='"Arnaud G. GIBERT" <arnaud@rx3.net>'
#-------------------------------------------------------------------------------
# User Settings
#-------------------------------------------------------------------------------
#APPL_ENV="prd"
#APPL_ENV="tst"
#APPL_ENV="int"
APPL_ENV="dvp"
#-------------------------------------------------------------------------------
# Common
#-------------------------------------------------------------------------------
APPL_USER="apache"
APPL_GROUP="apache"
if [[ "${APPL_ENV}" != "prd" ]]
then
APPL_SUFFIX="-${APPL_ENV}"
PORT_ENV_OFFSET=100
else
APPL_SUFFIX=""
PORT_ENV_OFFSET=0
fi
ORG_URL_PREFIX="${ORG_REGISTRY}/${ORG_NAME}"
APPL_URL_PREFIX="${ORG_REGISTRY}/${APPL_ORG}/${APPL_NAME_SHORT}"
HOST_NAME_PREFIX=${APPL_NAME_SHORT}${APPL_SUFFIX}
PORT_ENV_OFFSET=0
PORT_SV_INT=9001
PORT_SV_OFFSET=1000
NETWORK_NAME=${HOST_NAME_PREFIX}
NETWORK_IF_NAME=br-${HOST_NAME_PREFIX}
DOCKER_TOOLS_DEBUG=FALSE
DOCKER_TOOLS_VOLUME=MIXED
#DOCKER_TOOLS_VOLUME=MERGED
DOCKER_TOOLS_EXEPTION_LIBS="postgres:pgsql"
#------------------+----------+--------------------------+--------------------+------------------+-------------------------------+----------------------+--------------------+---------------+------------+--------------+------------+-------+-------+-------+-------+--------------+--------------+
# | Variable | Service | Target Image | From Image | Module | Main Port | Admin Port | User | Group |
# | Prefix | Name | URL Prefix | Name | Name Full | Version | URL Prefix | Name | Version | Name | Version | Ext | Int | Ext | Int | Name / Id | Name / Id |
#------------------+----------+--------------------------+--------------------+------------------+-------------------------------+----------------------+--------------------+---------------+------------+--------------+------------+-------+-------+-------+-------+--------------+--------------+
docker_service_add DB database ${ORG_URL_PREFIX} postgresql - 1.1.2-mga9 - - - postgres - - 5432 - - postgres postgres
docker_service_add WA webapp ${ORG_URL_PREFIX} squashtm "Rx3-Docker/Squash-TM" ${APPL_VERSION}-mga9 ${ORG_URL_PREFIX} java 1.1.1-mga9 - - 8071 8080 - - ${APPL_USER} ${APPL_GROUP}
#-------------------------------------------------------------------------------
# Database
#-------------------------------------------------------------------------------
DB_POSTGRES_PASSWORD="postgresadmin"
DB_NAME="squashtm"
DB_USER="squashtm"
DB_PASSWORD="squashtmadmin"
DB_SERVER_NAME="Squash TM"
#-------------------------------------------------------------------------------
# WebApp
#-------------------------------------------------------------------------------
WA_CROND_ENABLED="FALSE"
WA_APACHE_DOC_ROOT="/var/www/html"
WA_PHP_UPLOAD_LIMIT="64M"
WA_LOG_HTTPD_EXT="./var/log/httpd-webapp"
WA_LOG_HTTPD_INT="/var/log/httpd"
WA_CONF_EXT=./etc/${APPL_NAME}
WA_CONF_INT=${WA_APACHE_DOC_ROOT}/${APPL_NAME}/config
#
#docker_config_add ${WA_CONF_EXT}/config_inc.php ${WA_CONF_EXT}/config_inc.php.ref
#
#WA_SMTP_SERVER="mail.rx3.net"
#WA_WINDOW_TITLE="MantisBT - Arena-SI"
#WA_LOGO_IMG="images-local/arena-si.jpg"
#
#if [[ "${APPL_ENV}" != "prd" ]]
#then
# WA_APPL_URL="http://localhost:${WA_PORT_MAIN_EXT}/${APPL_NAME}/"
#else
# WA_APPL_URL="https://private.arena-si.fr/tools/${APPL_NAME}/"
#fi
WA_MANTISBT_ADMIN_ENABLED="TRUE"
#WA_MANTISBT_ADMIN_ENABLED="FALSE"
WA_IMG_EXT=./var/www/html/${APPL_NAME}/images-local
WA_IMG_INT=${WA_APACHE_DOC_ROOT}/${APPL_NAME}/images-local
WA_LOG_MAIN_EXT=./var/log/squashtm
WA_LOG_MAIN_INT=/var/log/squashtm