@@ -159,7 +159,8 @@ RUN mkdir -p /opt/app-root/extensions-temp && \
159
159
code-server --install-extension /opt/app-root/bin/utils/ms-toolsai.jupyter-2025.2.0.vsix --extensions-dir /opt/app-root/extensions-temp
160
160
161
161
# Install NGINX to proxy code-server and pass probes check
162
- ENV NGINX_VERSION=1.24 \
162
+ ENV APP_ROOT=/opt/app-root \
163
+ NGINX_VERSION=1.24 \
163
164
NGINX_SHORT_VER=124 \
164
165
NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \
165
166
NGINX_CONF_PATH=/etc/nginx/nginx.conf \
@@ -170,17 +171,23 @@ ENV NGINX_VERSION=1.24 \
170
171
NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl
171
172
172
173
# Modules does not exist
173
- RUN dnf install -y https://download.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
174
- INSTALL_PKGS="bind-utils nginx nginx-mod-stream nginx-mod-http-perl fcgiwrap initscripts chkconfig supervisor" && \
174
+ RUN INSTALL_PKGS="bind-utils nginx nginx-mod-stream nginx-mod-http-perl httpd" && \
175
175
dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
176
176
rpm -V $INSTALL_PKGS && \
177
177
dnf -y clean all --enablerepo='*'
178
178
179
- COPY --chown=1001:0 ${CODESERVER_SOURCE_CODE}/supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
179
+ # Configure httpd for CGI processing
180
+ COPY --chown=1001:0 ${CODESERVER_SOURCE_CODE}/httpd/httpd.conf /etc/httpd/conf/httpd.conf
181
+ COPY --chown=1001:0 ${CODESERVER_SOURCE_CODE}/httpd/codeserver-cgi.conf /etc/httpd/conf.d/codeserver-cgi.conf
180
182
181
183
# Copy extra files to the image.
182
184
COPY --chown=1001:0 ${CODESERVER_SOURCE_CODE}/nginx/root/ /
183
185
186
+ ## Configure nginx
187
+ COPY ${CODESERVER_SOURCE_CODE}/nginx/serverconf/ /opt/app-root/etc/nginx.default.d/
188
+ COPY ${CODESERVER_SOURCE_CODE}/nginx/httpconf/ /opt/app-root/etc/nginx.d/
189
+ COPY ${CODESERVER_SOURCE_CODE}/nginx/api/ /opt/app-root/api/
190
+
184
191
# Changing ownership and user rights to support following use-cases:
185
192
# 1) running container on OpenShift, whose default security model
186
193
# is to run the container under random UID, but GID=0
@@ -199,14 +206,20 @@ RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \
199
206
mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \
200
207
mkdir -p ${NGINX_LOG_PATH} && \
201
208
mkdir -p ${NGINX_PERL_MODULE_PATH} && \
209
+ # Create httpd directories and set permissions
210
+ mkdir -p /var/log/httpd /var/run/httpd /etc/httpd/logs && \
202
211
chown -R 1001:0 ${NGINX_CONF_PATH} && \
203
212
chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \
204
213
chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \
205
214
chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \
215
+ chown -R 1001:0 /var/log/httpd /var/run/httpd /etc/httpd/logs && \
206
216
chmod ug+rw ${NGINX_CONF_PATH} && \
207
217
chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \
208
218
chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \
209
219
chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \
220
+ chmod -R ug+rwX /var/log/httpd /var/run/httpd /etc/httpd/logs && \
221
+ # Make CGI script executable
222
+ chmod +x /opt/app-root/api/kernels/access.cgi && \
210
223
rpm-file-permissions && \
211
224
# Ensure the temporary directory and target directory have the correct permissions
212
225
mkdir -p /opt/app-root/src/.local/share/code-server/extensions && \
@@ -215,11 +228,6 @@ RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \
215
228
chown -R 1001:0 /opt/app-root/extensions-temp && \
216
229
chown -R 1001:0 /opt/app-root/src/.config/code-server
217
230
218
- ## Configure nginx
219
- COPY ${CODESERVER_SOURCE_CODE}/nginx/serverconf/ /opt/app-root/etc/nginx.default.d/
220
- COPY ${CODESERVER_SOURCE_CODE}/nginx/httpconf/ /opt/app-root/etc/nginx.d/
221
- COPY ${CODESERVER_SOURCE_CODE}/nginx/api/ /opt/app-root/api/
222
-
223
231
# Launcher
224
232
COPY --chown=1001:0 ${CODESERVER_SOURCE_CODE}/run-code-server.sh ${CODESERVER_SOURCE_CODE}/run-nginx.sh ./
225
233
0 commit comments