Skip to content

Commit bbba58c

Browse files
Merge pull request #587 from atheo89/replace-spawn-fcgi
feat(RHOAIENG-8298): Replace `spawn-fcgi` with `supervisord` in code-server and r-studio server
2 parents 088ab3c + 6ce17a4 commit bbba58c

File tree

6 files changed

+26
-10
lines changed

6 files changed

+26
-10
lines changed

codeserver/ubi9-python-3.9/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ ENV NGINX_VERSION=1.24 \
6060

6161
# Modules does not exist
6262
RUN yum install -y https://download.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
63-
INSTALL_PKGS="bind-utils nginx nginx-mod-stream nginx-mod-http-perl fcgiwrap initscripts chkconfig" && \
63+
INSTALL_PKGS="bind-utils nginx nginx-mod-stream nginx-mod-http-perl fcgiwrap initscripts chkconfig supervisor" && \
6464
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
6565
rpm -V $INSTALL_PKGS && \
66-
# spawn-fcgi is not in epel9 \
67-
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 && \
6866
yum -y clean all --enablerepo='*'
6967

68+
COPY --chown=1001:0 supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
69+
7070
# Copy extra files to the image.
7171
COPY nginx/root/ /
7272

codeserver/ubi9-python-3.9/run-code-server.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
SCRIPT_DIR=$(dirname -- "$0")
55
source ${SCRIPT_DIR}/utils/*.sh
66

7-
# Start nginx and fastcgiwrap
7+
# Start nginx and supervisord
88
run-nginx.sh &
9-
spawn-fcgi -s /var/run/fcgiwrap.socket -M 766 /usr/sbin/fcgiwrap
9+
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf &
1010

1111
# Add .bashrc for custom promt if not present
1212
if [ ! -f "/opt/app-root/src/.bashrc" ]; then
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[supervisord]
2+
nodaemon=true
3+
4+
[program:fcgiwrap]
5+
command=/usr/sbin/fcgiwrap -s unix:/var/run/fcgiwrap.socket
6+
autostart=true
7+
autorestart=true
8+
redirect_stderr=true

rstudio/c9s-python-3.9/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ ENV NGINX_VERSION=1.24 \
7373

7474
# Modules does not exist
7575
RUN yum -y module enable nginx:$NGINX_VERSION && \
76-
INSTALL_PKGS="nss_wrapper bind-utils gettext hostname nginx nginx-mod-stream nginx-mod-http-perl fcgiwrap initscripts chkconfig" && \
76+
INSTALL_PKGS="nss_wrapper bind-utils gettext hostname nginx nginx-mod-stream nginx-mod-http-perl fcgiwrap initscripts chkconfig supervisor" && \
7777
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
7878
rpm -V $INSTALL_PKGS && \
7979
nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \
80-
# spawn-fcgi is not in epel9
81-
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 && \
8280
yum -y clean all --enablerepo='*'
8381

82+
COPY --chown=1001:0 supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
83+
8484
# Copy extra files to the image.
8585
COPY nginx/root/ /
8686

rstudio/c9s-python-3.9/run-rstudio.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
SCRIPT_DIR=$(dirname -- "$0")
55
source ${SCRIPT_DIR}/utils/*.sh
66

7-
# Start nginx and fastcgiwrap
7+
# Start nginx and supervisord
88
run-nginx.sh &
9-
spawn-fcgi -s /var/run/fcgiwrap.socket -M 766 /usr/sbin/fcgiwrap
9+
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf &
1010

1111

1212
# Add .bashrc for custom promt if not present
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[supervisord]
2+
nodaemon=true
3+
4+
[program:fcgiwrap]
5+
command=/usr/sbin/fcgiwrap -s unix:/var/run/fcgiwrap.socket
6+
autostart=true
7+
autorestart=true
8+
redirect_stderr=true

0 commit comments

Comments
 (0)