diff --git a/Dockerfile b/Dockerfile index e3ce9d4..ee4e4f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,34 +17,38 @@ LABEL maintainer=${IMG_MAINTAINER} ARG TOMCAT_CONFIG_DIR=/etc/tomcat ARG TOMCAT_CONFIG_FILE=${TOMCAT_CONFIG_DIR}/tomcat.conf +ARG TOMCAT_CACHE_DIR=/var/cache/tomcat ARG TOMCAT_LIB_DIR=/var/lib/tomcat ARG TOMCAT_LOG_DIR=/var/log/tomcat +ARG TOMCAT_SHARE_DIR=/usr/share/tomcat +ARG TOMCAT_WORK_DIR=${TOMCAT_CACHE_DIR}/work 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='#!/bin/bash \n\ + \n\ +usermod -u ${TOMCAT_UID} tomcat \n\ +groupmod -g ${TOMCAT_GID} tomcat \n\ + \n\ +chown -R root:tomcat '${TOMCAT_CONFIG_DIR}' '${TOMCAT_CACHE_DIR}' '${TOMCAT_LIB_DIR}' '${TOMCAT_SHARE_DIR}' \n\ +chown -R tomcat:tomcat '${TOMCAT_LOG_DIR}' '${TOMCAT_WORK_DIR} +#---------------------------------------------------------------------------------------------------------------- -#--------------------------------------------------------------------------------------------------- -ARG TOMCATD_INI='[program:tomcatd] \n\ -command=bash -c "source '${TOMCAT_CONFIG_FILE}' && /usr/libexec/tomcat/server start" \n\ +#---------------------------------------------------------------------------------------------------------------- +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 \ +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