@@ -129,16 +129,23 @@ ENV NGINX_VERSION=1.24 \
129129
130130# Modules does not exist
131131RUN dnf -y module enable nginx:$NGINX_VERSION && \
132- INSTALL_PKGS="nss_wrapper bind-utils gettext hostname nginx nginx-mod-stream nginx-mod-http-perl fcgiwrap initscripts chkconfig supervisor " && \
132+ INSTALL_PKGS="nss_wrapper bind-utils gettext hostname nginx nginx-mod-stream nginx-mod-http-perl httpd " && \
133133 dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
134134 rpm -V $INSTALL_PKGS && \
135135 nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \
136136 dnf -y clean all --enablerepo='*'
137137
138- COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
138+ # Configure httpd for CGI processing
139+ COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/httpd/httpd.conf /etc/httpd/conf/httpd.conf
140+ COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/httpd/rstudio-cgi.conf /etc/httpd/conf.d/rstudio-cgi.conf
139141
140142# Copy extra files to the image.
141- COPY ${RSTUDIO_SOURCE_CODE}/nginx/root/ /
143+ COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/nginx/root/ /
144+
145+ # Configure nginx
146+ COPY ${RSTUDIO_SOURCE_CODE}/nginx/serverconf/ /opt/app-root/etc/nginx.default.d/
147+ COPY ${RSTUDIO_SOURCE_CODE}/nginx/httpconf/ /opt/app-root/etc/nginx.d/
148+ COPY ${RSTUDIO_SOURCE_CODE}/nginx/api/ /opt/app-root/api/
142149
143150# Changing ownership and user rights to support following use-cases:
144151# 1) running container on OpenShift, whose default security model
@@ -158,21 +165,23 @@ RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \
158165 mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \
159166 mkdir -p ${NGINX_LOG_PATH} && \
160167 mkdir -p ${NGINX_PERL_MODULE_PATH} && \
168+ # Create httpd directories and set permissions
169+ mkdir -p /var/log/httpd /var/run/httpd /etc/httpd/logs && \
161170 chown -R 1001:0 ${NGINX_CONF_PATH} && \
162171 chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \
163172 chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \
164173 chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \
174+ # Create httpd directories and set permissions
175+ mkdir -p /var/log/httpd /var/run/httpd /etc/httpd/logs && \
165176 chmod ug+rw ${NGINX_CONF_PATH} && \
166177 chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \
167178 chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \
168179 chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \
180+ chmod -R ug+rwX /var/log/httpd /var/run/httpd /etc/httpd/logs && \
181+ # Make CGI script executable
182+ chmod +x /opt/app-root/api/kernels/access.cgi && \
169183 rpm-file-permissions
170184
171- # Configure nginx
172- COPY ${RSTUDIO_SOURCE_CODE}/nginx/serverconf/ /opt/app-root/etc/nginx.default.d/
173- COPY ${RSTUDIO_SOURCE_CODE}/nginx/httpconf/ /opt/app-root/etc/nginx.d/
174- COPY ${RSTUDIO_SOURCE_CODE}/nginx/api/ /opt/app-root/api/
175-
176185# Launcher
177186WORKDIR /opt/app-root/bin
178187
0 commit comments