- Move & Rename repo from Rx3/Server-MGA9 to Rx3-Docker/Server,

- New version naming standard,
- Now use docker_tools for .env building,
- Use now rx3-docker/base:1.3.0-mga9 image,
- Add crond enabling via SERVER_CROND_ENABLE environement variable.
This commit is contained in:
2024-11-10 23:29:56 +01:00
parent eade80234e
commit 28e24b2bd9
5 changed files with 78 additions and 39 deletions

View File

@@ -1,16 +1,17 @@
# Rx3 Server Mageia-9 Docker Image
# Rx3-Docker/Server Docker Image
#-------------------------------------------------------------------------------
ARG IMG_URL_PREFIX="rx3"
FROM ${IMG_URL_PREFIX}/base-mga9:1.2.6
ARG IMG_NAME
ARG IMG_FULL_NAME
ARG IMG_NAME_FULL
ARG IMG_VERSION
ARG IMG_MAINTAINER
ARG IMG_FROM_URL
LABEL org.rx3.${IMG_NAME}.name=${IMG_FULL_NAME}
ARG SERVER_PORT_SV_INT
FROM ${IMG_FROM_URL}
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}
@@ -41,6 +42,21 @@ do
done'
#---------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
ARG SUPERVISORD='#!/bin/bash \n\
\n\
exec supervisord -c /etc/supervisord.conf'
#---------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
ARG CROND='#!/bin/bash \n\
\n\
if [[ "${SERVER_CROND_ENABLED}" != "TRUE" ]] \n\
then \n\
mv /etc/supervisord.d/crond.ini /etc/supervisord.d/crond.ini.disabled \n\
fi'
#---------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
ARG SUPERVISORD_INI='[inet_http_server] \n\
port=*:9001 \n\
@@ -50,18 +66,11 @@ nodaemon=true
user=root'
#---------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
ARG CROND_INI='[program:crond] \n\
command=crond -n'
#---------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
ARG SUPERVISORD='#!/bin/bash \n\
\n\
exec supervisord -c /etc/supervisord.conf'
#---------------------------------------------------------------------------------------------------
RUN urpmi --force supervisor \
@@ -69,14 +78,17 @@ RUN urpmi --force supervisor
&& chmod a+x /usr/local/sbin/init.sh \
&& mkdir /etc/rc.d/rcD.d \
&& ln -s /etc/rc.d/rcD.d /etc \
&& echo -e "${SUPERVISORD_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/supervisord.ini \
&& echo -e "${CROND_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/crond.ini \
&& echo -e "${SUPERVISORD}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/supervisord \
&& echo -e "${CROND}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/crond \
&& echo -e "${SUPERVISORD}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/supervisord \
&& chmod a+x /etc/init.d/crond \
&& chmod a+x /etc/init.d/supervisord \
&& ln -s /etc/init.d/supervisord /etc/rcD.d/S99supervisord
&& ln -s /etc/init.d/crond /etc/rcD.d/S60crond \
&& ln -s /etc/init.d/supervisord /etc/rcD.d/S99supervisord \
&& echo -e "${CROND_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/crond.ini \
&& echo -e "${SUPERVISORD_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/supervisord.ini
EXPOSE 9001
EXPOSE ${SERVER_PORT_SV_INT}
CMD []
ENTRYPOINT ["init.sh"]