Compare commits

..

No commits in common. "master" and "server-mga9-1.1.0" have entirely different histories.

7 changed files with 52 additions and 153 deletions

View File

@ -1,14 +1,13 @@
# Rx3-Docker/Server Docker Image # Rx3 Server Mageia-9 Docker Image
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Global Settings # Global Settings
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
ORG_NAME="rx3-docker" IMG_ORG="rx3"
ORG_REGISTRY="docker.xor.rx3:5000" IMG_REGISTRY="docker.xor.rx3:5000"
IMG_URL_PREFIX="${IMG_REGISTRY}/${IMG_ORG}"
ORG_URL_PREFIX="${ORG_REGISTRY}/${ORG_NAME}"
@ -16,31 +15,14 @@ ORG_URL_PREFIX="${ORG_REGISTRY}/${ORG_NAME}"
# Image Settings # Image Settings
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
IMG_NAME="server" IMG_ID="server-mga9"
IMG_NAME_FULL="Rx3-Docker/Server Docker Image" IMG_NAME="Rx3 Server Mageia-9 Docker Image"
IMG_VERSION="1.2.0-mga9" IMG_VERSION="1.1.0"
IMG_URL="${IMG_URL_PREFIX}/${IMG_ID}:${IMG_VERSION}"
IMG_MAINTAINER='"Arnaud G. GIBERT" <arnaud@rx3.net>' IMG_MAINTAINER='"Arnaud G. GIBERT" <arnaud@rx3.net>'
IMG_URL_PREFIX="${ORG_URL_PREFIX}"
IMG_URL="${IMG_URL_PREFIX}/${IMG_NAME}:${IMG_VERSION}"
IMG_FROM_URL="${ORG_URL_PREFIX}/base:1.3.0-mga9"
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# User Settings # User Settings
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
ENV_PORT_OFFSET=0
SV_PORT_OFFSET=1000
SERVER_PORT_MAIN_EXT=$(( 8080 + ${ENV_PORT_OFFSET}))
SERVER_PORT_SV_EXT=$(( ${SERVER_PORT_MAIN_EXT} + ${SV_PORT_OFFSET}))
SERVER_PORT_SV_INT=9001
SERVER_LOG_INIT_DIR="/var/log/init"
SERVER_LOG_SV_DIR="/var/log/supervisor"
SERVER_CROND_ENABLED="FALSE"

View File

@ -1,32 +1,26 @@
# Rx3-Docker/Server Docker Image # Rx3 Server Mageia-9 Docker Image
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
ARG IMG_FROM_URL="rx3-docker/base:latest" ARG IMG_URL_PREFIX="rx3"
FROM ${IMG_FROM_URL} FROM ${IMG_URL_PREFIX}/base-mga9:1.2.2
ARG IMG_ID
ARG IMG_NAME ARG IMG_NAME
ARG IMG_NAME_FULL
ARG IMG_VERSION ARG IMG_VERSION
ARG IMG_MAINTAINER ARG IMG_MAINTAINER
LABEL org.rx3.${IMG_NAME}.name=${IMG_NAME_FULL} LABEL org.rx3.${IMG_ID}.name=${IMG_NAME}
LABEL org.rx3.${IMG_NAME}.version=${IMG_VERSION} LABEL org.rx3.${IMG_ID}.version=${IMG_VERSION}
LABEL org.rx3.${IMG_NAME}.maintainer=${IMG_MAINTAINER} LABEL org.rx3.${IMG_ID}.maintainer=${IMG_MAINTAINER}
LABEL maintainer=${IMG_MAINTAINER} LABEL maintainer=${IMG_MAINTAINER}
ARG SERVER_LOG_INIT_DIR
ARG SERVER_LOG_SV_DIR
ARG SERVER_PORT_SV_INT
ARG SERVER_LOG_INIT_FILE=${SERVER_LOG_INIT_DIR}/init.log
#--------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------
ARG INIT_SHELL='#!/bin/bash \n\ ARG INIT_SHELL='#!/bin/bash \n\
\n\ \n\
function log() { echo "$(date --rfc-3339=ns) Init: $*" | tee -a '${SERVER_LOG_INIT_FILE}'; } \n\ function log() { echo "$(date --rfc-3339=ns) Init: $*" | tee -a /var/log/init.log; } \n\
\n\ \n\
log "Starting" \n\ log "Starting" \n\
\n\ \n\
@ -47,58 +41,42 @@ do
done' 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\ ARG SUPERVISORD_INI='[inet_http_server] \n\
port=*:'${SERVER_PORT_SV_INT}' \n\ port=*:9001 \n\
\n\ \n\
[supervisord] \n\ [supervisord] \n\
nodaemon=true \n\ nodaemon=true \n\
childlogdir='${SERVER_LOG_SV_DIR}' \n\
user=root' user=root'
#--------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------
ARG CROND_INI='[program:crond] \n\ ARG CROND_INI='[program:crond] \n\
command=crond -n' command=crond -n'
#--------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
ARG SUPERVISORD='#!/bin/bash \n\
\n\
exec supervisord -c /etc/supervisord.conf'
#---------------------------------------------------------------------------------------------------
RUN urpmi --force supervisor \
&& echo -e "${INIT_SHELL}" | sed -e "s/\`/'/g" -e 's/ *$//' > /usr/local/sbin/init.sh \ RUN urpmi --force supervisor \
&& chmod a+x /usr/local/sbin/init.sh \ && echo -e "${INIT_SHELL}" | sed -e 's/ *$//' >/usr/local/sbin/init.sh \
&& mkdir /etc/rc.d/rcD.d \ && chmod a+x /usr/local/sbin/init.sh \
&& ln -s /etc/rc.d/rcD.d /etc \ && mkdir /etc/rc.d/rcD.d \
&& mkdir "${SERVER_LOG_INIT_DIR}" \ && ln -s /etc/rc.d/rcD.d /etc \
&& echo -e "${CROND}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/crond \ && echo -e "${SUPERVISORD_INI}" | sed -e 's/ *$//' > /etc/supervisord.d/supervisord.ini \
&& echo -e "${SUPERVISORD}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/supervisord \ && echo -e "${CROND_INI}" | sed -e 's/ *$//' > /etc/supervisord.d/crond.ini \
&& chmod a+x /etc/init.d/crond \ && echo -e "${SUPERVISORD}" | sed -e 's/ *$//' > /etc/init.d/supervisord \
&& chmod a+x /etc/init.d/supervisord \ && chmod a+x /etc/init.d/supervisord \
&& ln -s /etc/init.d/crond /etc/rcD.d/S60crond \ && ln -s /etc/init.d/supervisord /etc/rcD.d/S99supervisord
&& 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
VOLUME ${SERVER_LOG_INIT_DIR} EXPOSE 9001
VOLUME ${SERVER_LOG_SV_DIR}
EXPOSE ${SERVER_PORT_SV_INT}
CMD [] CMD []
ENTRYPOINT ["init.sh"] ENTRYPOINT ["init.sh"]

View File

@ -1,15 +1,14 @@
Welcome to Rx3-Docker/Server docker image! Welcome to Rx3/Server-Mga9 docker image!
This project aims to build a Mageia server docker image to be used by other Rx3 packaging projects. This is project aims to build a Mageia-9 server docker image to be used by others Rx3 packaging projects.
Features: Features:
- Curtently based on rx3-docker/base:1.3.0-mga9 image, - Curtently based on rx3/base-mga9:1.2.2 image,
- Init script calling in order sub scripts in /etc/init.d & /etc/rcD.d, - Init script calling in order sub scripts in /etc/init.d & /etc/rcD.d,
- supervisord managing services, - supervisord managing services,
- crond & logrotate configured & crond disabled by default, - crond & logrotate configured.
- Export init & supivisor log directories as volume.
Enjoy it! Enjoy it!
@ -17,4 +16,4 @@ Enjoy it!
Your Rx3 Team. Your Rx3 Team.
arnaud@rx3.net arnaud@rx3.net
https://git.rx3.org/gitea/rx3-docker/server https://git.rx3.org/gitea/rx3/server-mga9

View File

@ -1,43 +1,3 @@
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/Server V 1.2.0 - A. GIBERT - 2024/11/10
------------------------------------------------------------------------------------------------------------------------------------
- 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,
- Add /var/log/init & var/log/supervisor volumes.
------------------------------------------------------------------------------------------------------------------------------------
Rx3/Server-Mga9 V 1.1.3 - A. GIBERT - 2024/10/05
------------------------------------------------------------------------------------------------------------------------------------
- Use now rx3/base-mga9:1.2.6 image,
- Variabilization of external server ports in env & compose file,
- Use now docker_tools for .env building.
------------------------------------------------------------------------------------------------------------------------------------
Rx3/Server-Mga9 V 1.1.2 - A. GIBERT - 2024/08/28
------------------------------------------------------------------------------------------------------------------------------------
- Use now rx3/base-mga9:1.2.4 image.
------------------------------------------------------------------------------------------------------------------------------------
Rx3/Server-Mga9 V 1.1.1 - A. GIBERT - 2024/08/27
------------------------------------------------------------------------------------------------------------------------------------
- Minor compose / dockerfile args & structure improvements,
- Use now rx3/base-mga9:1.2.3 image.
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
Rx3/Server-Mga9 V 1.1.0 - A. GIBERT - 2024/08/26 Rx3/Server-Mga9 V 1.1.0 - A. GIBERT - 2024/08/26
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------

View File

@ -1,37 +1,25 @@
# Rx3-Docker/Server Docker Image # Rx3 Server Mageia-9 Docker Image
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
name: ${IMG_NAME} name: ${IMG_ID}
services: services:
server: server:
container_name: ${IMG_NAME} container_name: ${IMG_ID}
hostname: ${IMG_NAME}
image: ${IMG_URL} image: ${IMG_URL}
build: build:
context: . context: .
args: args:
IMG_NAME: ${IMG_NAME} - IMG_ID=${IMG_ID}
IMG_NAME_FULL: ${IMG_NAME_FULL} - IMG_NAME=${IMG_NAME}
IMG_VERSION: ${IMG_VERSION} - IMG_VERSION=${IMG_VERSION}
IMG_MAINTAINER: ${IMG_MAINTAINER} - IMG_MAINTAINER=${IMG_MAINTAINER}
IMG_FROM_URL: ${IMG_FROM_URL} - IMG_URL_PREFIX=${IMG_URL_PREFIX}
SERVER_LOG_INIT_DIR: ${SERVER_LOG_INIT_DIR} restart: unless-stopped
SERVER_LOG_SV_DIR: ${SERVER_LOG_SV_DIR}
SERVER_PORT_SV_INT: ${SERVER_PORT_SV_INT}
restart: unless-stopped
environment:
SERVER_CROND_ENABLED: ${SERVER_CROND_ENABLED}
volumes:
- ./var/log/init:${SERVER_LOG_INIT_DIR}
- ./var/log/supervisor:${SERVER_LOG_SV_DIR}
ports: ports:
- "127.0.0.1:${SERVER_PORT_SV_EXT}:${SERVER_PORT_SV_INT}" - "127.0.0.1:9010:9001"

View File

@ -1,4 +0,0 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

View File

@ -1,4 +0,0 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore