From 5cd74a347d9ab0cb9da24e36642fc75f5080cf19 Mon Sep 17 00:00:00 2001 From: "Arnaud G. GIBERT" Date: Sat, 10 Jan 2026 13:27:51 +0100 Subject: [PATCH] - Initial release, - Based on rx3-docker/java-1.1.4-mga9 image, - Use Tomcat 9.0.111 from Mageia 9 RPM. --- .gitignore | 2 + Dockerfile | 52 ++++++++++++++ ReadMe.txt | 19 +++++ ReleaseNotes.txt | 7 ++ compose.yaml | 65 +++++++++++++++++ env.dist | 87 +++++++++++++++++++++++ var/log/init-appl-server/.gitignore | 4 ++ var/log/supervisor-appl-server/.gitignore | 4 ++ var/log/tomcat/.gitignore | 4 ++ 9 files changed, 244 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 ReadMe.txt create mode 100644 ReleaseNotes.txt create mode 100644 compose.yaml create mode 100644 env.dist create mode 100644 var/log/init-appl-server/.gitignore create mode 100644 var/log/supervisor-appl-server/.gitignore create mode 100644 var/log/tomcat/.gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..556bc65 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*~ +*.old diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e3ce9d4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,52 @@ +# Rx3-Docker/Tomcat 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 TOMCAT_CONFIG_DIR=/etc/tomcat +ARG TOMCAT_CONFIG_FILE=${TOMCAT_CONFIG_DIR}/tomcat.conf +ARG TOMCAT_LIB_DIR=/var/lib/tomcat +ARG TOMCAT_LOG_DIR=/var/log/tomcat +ARG TOMCAT_PORT=8080 + + + +#--------------------------------------------------------------------------------------------------- +ARG TOMCATD='#!/bin/bash \n\ + \n\ +usermod -u ${TOMCAT_UID} tomcat \n\ +groupmod -g ${TOMCAT_GID} tomcat \n\ + \n\ +chown -R tomcat:tomcat '${TOMCAT_CONFIG_DIR}' '${TOMCAT_LIB_DIR}' '${TOMCAT_LOG_DIR} +#--------------------------------------------------------------------------------------------------- + +#--------------------------------------------------------------------------------------------------- +ARG TOMCATD_INI='[program:tomcatd] \n\ +command=bash -c "source '${TOMCAT_CONFIG_FILE}' && /usr/libexec/tomcat/server start" \n\ +user=tomcat' +#--------------------------------------------------------------------------------------------------- + + + +RUN urpmi.update -a \ + && urpmi --force tomcat \ + && echo -e "${TOMCATD}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/tomcatd \ + && chmod a+x /etc/init.d/tomcatd \ + && ln -s /etc/init.d/tomcatd /etc/rcD.d/S40tomcatd \ + && echo -e "${TOMCATD_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/tomcatd.ini + + + +EXPOSE ${TOMCAT_PORT} diff --git a/ReadMe.txt b/ReadMe.txt new file mode 100644 index 0000000..a1b6c39 --- /dev/null +++ b/ReadMe.txt @@ -0,0 +1,19 @@ +Welcome to Rx3-Docker/Tomcat docker image! + + + +This project aims to build a Tomcat docker image. + +Features: + - Curtently based on rx3-docker/java:1.1.4-mga9 image, + - Sync with Tomcat 9.0.111 from Mageia 9 RPM. + + + +Enjoy it! + +Your Rx3 Team. + +-- +arnaud@rx3.net +https://git.rx3.org/gitea/rx3-docker/tomcat diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt new file mode 100644 index 0000000..f28f37c --- /dev/null +++ b/ReleaseNotes.txt @@ -0,0 +1,7 @@ +------------------------------------------------------------------------------------------------------------------------------------ +Rx3-Docker/Gitea V 1.0.0 - A. GIBERT - 2026/01/10 +------------------------------------------------------------------------------------------------------------------------------------ + +- Initial release, +- Based on rx3-docker/java-1.1.4-mga9 image, +- Use Tomcat 9.0.111 from Mageia 9 RPM. diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..83fdc4d --- /dev/null +++ b/compose.yaml @@ -0,0 +1,65 @@ +# Rx3-Docker/Tomcat Docker Image +#------------------------------------------------------------------------------- + +name: ${HOST_NAME_PREFIX} + +services: + appl-server: + container_name: ${AS_HOST_NAME} + hostname: ${AS_HOST_NAME} + + image: ${AS_IMG_URL} + + build: + dockerfile: Dockerfile + + context: . + args: + IMG_NAME: ${AS_IMG_URL} + IMG_NAME_FULL: ${AS_IMG_NAME_FULL} + IMG_VERSION: ${AS_IMG_VERSION} + IMG_MAINTAINER: ${APPL_MAINTAINER} + IMG_FROM_URL: ${AS_IMG_FROM_URL} + + restart: unless-stopped + + environment: + SERVER_CROND_ENABLED: ${AS_CROND_ENABLED} + TOMCAT_UID: ${AS_USER_ID} + TOMCAT_GID: ${AS_GROUP_ID} + + healthcheck: + test: ["CMD", "curl", "-sS", "http://localhost:${AS_PORT_MAIN_INT}"] + interval: 10s + timeout: 3s + retries: 3 + + volumes: + - ./${AS_LOG_INIT_EXT}:${AS_LOG_INIT_INT} + - ./${AS_LOG_SV_EXT}:${AS_LOG_SV_INT} + - ./${AS_LOG_MAIN_EXT}:${AS_LOG_MAIN_INT} + + networks: + - appl +# - internal + + ports: + - "127.0.0.1:${AS_PORT_SV_EXT}:${AS_PORT_SV_INT}" + - "127.0.0.1:${AS_PORT_MAIN_EXT}:${AS_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 diff --git a/env.dist b/env.dist new file mode 100644 index 0000000..de0779e --- /dev/null +++ b/env.dist @@ -0,0 +1,87 @@ +# Rx3-Docker/Tomcat 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="tomcat" +APPL_NAME_FULL="Tomcat Server" +APPL_NAME_SHORT="tomcat" +APPL_ORG="rx3-docker" +APPL_VERSION="1.0.0" +APPL_MAINTAINER='"Arnaud G. GIBERT" ' + + + +#------------------------------------------------------------------------------- +# User Settings +#------------------------------------------------------------------------------- + +#APPL_ENV="prd" +#APPL_ENV="tst" +#APPL_ENV="int" +APPL_ENV="dvp" + +WA_REPOS_EXT=./var/lib/tomcat/repositories + + + +#------------------------------------------------------------------------------- +# Common +#------------------------------------------------------------------------------- + +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 AS appl-server ${ORG_URL_PREFIX} tomcat "Rx3-Docker/Tomcat" ${APPL_VERSION}-mga9 ${ORG_URL_PREFIX} java 1.1.4-mga9 - - 8077 8080 - - apache apache + + + +#------------------------------------------------------------------------------- +# Appl Server +#------------------------------------------------------------------------------- + +AS_CROND_ENABLED="FALSE" diff --git a/var/log/init-appl-server/.gitignore b/var/log/init-appl-server/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/init-appl-server/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/var/log/supervisor-appl-server/.gitignore b/var/log/supervisor-appl-server/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/supervisor-appl-server/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/var/log/tomcat/.gitignore b/var/log/tomcat/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/tomcat/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore