From 6ce17a4d9effb0ad1a905c47cbcd24f5f90c3a7b Mon Sep 17 00:00:00 2001 From: atheo89 Date: Thu, 13 Jun 2024 13:34:05 +0200 Subject: [PATCH] Replace spawn-fcgi with supervisord in code-server and r-studio server --- codeserver/ubi9-python-3.9/Dockerfile | 6 +++--- codeserver/ubi9-python-3.9/run-code-server.sh | 4 ++-- codeserver/ubi9-python-3.9/supervisord/supervisord.conf | 8 ++++++++ rstudio/c9s-python-3.9/Dockerfile | 6 +++--- rstudio/c9s-python-3.9/run-rstudio.sh | 4 ++-- rstudio/c9s-python-3.9/supervisord/supervisord.conf | 8 ++++++++ 6 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 codeserver/ubi9-python-3.9/supervisord/supervisord.conf create mode 100644 rstudio/c9s-python-3.9/supervisord/supervisord.conf diff --git a/codeserver/ubi9-python-3.9/Dockerfile b/codeserver/ubi9-python-3.9/Dockerfile index 42eda0a74..4b40b2adc 100644 --- a/codeserver/ubi9-python-3.9/Dockerfile +++ b/codeserver/ubi9-python-3.9/Dockerfile @@ -60,13 +60,13 @@ ENV NGINX_VERSION=1.24 \ # Modules does not exist RUN yum install -y https://download.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \ - INSTALL_PKGS="bind-utils nginx nginx-mod-stream nginx-mod-http-perl fcgiwrap initscripts chkconfig" && \ + INSTALL_PKGS="bind-utils nginx nginx-mod-stream nginx-mod-http-perl fcgiwrap initscripts chkconfig supervisor" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ - # spawn-fcgi is not in epel9 \ - rpm -i --nodocs https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/37/Everything/x86_64/os/Packages/s/spawn-fcgi-1.6.3-23.fc37.x86_64.rpm && \ yum -y clean all --enablerepo='*' +COPY --chown=1001:0 supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf + # Copy extra files to the image. COPY nginx/root/ / diff --git a/codeserver/ubi9-python-3.9/run-code-server.sh b/codeserver/ubi9-python-3.9/run-code-server.sh index 5a606ff4b..0824ae28f 100755 --- a/codeserver/ubi9-python-3.9/run-code-server.sh +++ b/codeserver/ubi9-python-3.9/run-code-server.sh @@ -4,9 +4,9 @@ SCRIPT_DIR=$(dirname -- "$0") source ${SCRIPT_DIR}/utils/*.sh -# Start nginx and fastcgiwrap +# Start nginx and supervisord run-nginx.sh & -spawn-fcgi -s /var/run/fcgiwrap.socket -M 766 /usr/sbin/fcgiwrap +/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf & # Add .bashrc for custom promt if not present if [ ! -f "/opt/app-root/src/.bashrc" ]; then diff --git a/codeserver/ubi9-python-3.9/supervisord/supervisord.conf b/codeserver/ubi9-python-3.9/supervisord/supervisord.conf new file mode 100644 index 000000000..801ac53ba --- /dev/null +++ b/codeserver/ubi9-python-3.9/supervisord/supervisord.conf @@ -0,0 +1,8 @@ +[supervisord] +nodaemon=true + +[program:fcgiwrap] +command=/usr/sbin/fcgiwrap -s unix:/var/run/fcgiwrap.socket +autostart=true +autorestart=true +redirect_stderr=true diff --git a/rstudio/c9s-python-3.9/Dockerfile b/rstudio/c9s-python-3.9/Dockerfile index f67f97ce8..0d086fbc0 100644 --- a/rstudio/c9s-python-3.9/Dockerfile +++ b/rstudio/c9s-python-3.9/Dockerfile @@ -73,14 +73,14 @@ ENV NGINX_VERSION=1.24 \ # Modules does not exist RUN yum -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper bind-utils gettext hostname nginx nginx-mod-stream nginx-mod-http-perl fcgiwrap initscripts chkconfig" && \ + INSTALL_PKGS="nss_wrapper bind-utils gettext hostname nginx nginx-mod-stream nginx-mod-http-perl fcgiwrap initscripts chkconfig supervisor" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ - # spawn-fcgi is not in epel9 - rpm -i --nodocs https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/37/Everything/x86_64/os/Packages/s/spawn-fcgi-1.6.3-23.fc37.x86_64.rpm && \ yum -y clean all --enablerepo='*' +COPY --chown=1001:0 supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf + # Copy extra files to the image. COPY nginx/root/ / diff --git a/rstudio/c9s-python-3.9/run-rstudio.sh b/rstudio/c9s-python-3.9/run-rstudio.sh index 7099415ed..25cb38fdf 100755 --- a/rstudio/c9s-python-3.9/run-rstudio.sh +++ b/rstudio/c9s-python-3.9/run-rstudio.sh @@ -4,9 +4,9 @@ SCRIPT_DIR=$(dirname -- "$0") source ${SCRIPT_DIR}/utils/*.sh -# Start nginx and fastcgiwrap +# Start nginx and supervisord run-nginx.sh & -spawn-fcgi -s /var/run/fcgiwrap.socket -M 766 /usr/sbin/fcgiwrap +/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf & # Add .bashrc for custom promt if not present diff --git a/rstudio/c9s-python-3.9/supervisord/supervisord.conf b/rstudio/c9s-python-3.9/supervisord/supervisord.conf new file mode 100644 index 000000000..801ac53ba --- /dev/null +++ b/rstudio/c9s-python-3.9/supervisord/supervisord.conf @@ -0,0 +1,8 @@ +[supervisord] +nodaemon=true + +[program:fcgiwrap] +command=/usr/sbin/fcgiwrap -s unix:/var/run/fcgiwrap.socket +autostart=true +autorestart=true +redirect_stderr=true