From 4dc7f58b110719de3900121a2d09ae45037943ca Mon Sep 17 00:00:00 2001
From: "Suren A. Chilingaryan" <csa@suren.me>
Date: Fri, 16 Aug 2019 07:03:18 +0200
Subject: Don't crash if no modules configured

---
 2.4/Dockerfile | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

(limited to '2.4/Dockerfile')

diff --git a/2.4/Dockerfile b/2.4/Dockerfile
index 87a63d4..874b2d1 100644
--- a/2.4/Dockerfile
+++ b/2.4/Dockerfile
@@ -48,19 +48,25 @@ RUN set -ex; \
     # Include enabled configs and sites.
     printf '%s\n' "PidFile /tmp/httpd.pid" \
         >> "conf/httpd.conf"; \
-    printf '%s\n' "Include conf/conf-enabled/*.conf" \
-        >> "conf/httpd.conf"; \
     printf '%s\n' "Include conf/sites-enabled/*.conf" \
         >> "conf/httpd.conf"; \
+    printf '%s\n' "Include conf/conf-enabled/*.conf" \
+        >> "conf/httpd.conf"; \
     # Enable module configuration and default site.
+    \
+    have_conf=0; \
     mkdir -p "conf/conf-enabled"; \
     mkdir -p "conf/sites-enabled"; \
     for i in $modules; do \
         if [ -f ../conf-available/${i}.conf ]; then \
+            have_conf=1; \
             ln -s ../conf-available/${i}.conf "conf/conf-enabled"; \
         fi; \
     done; \
-    ln -s ../sites-available/default.conf "conf/sites-enabled"
+    ln -s ../sites-available/default.conf "conf/sites-enabled"; \
+    if [ $have_conf -eq 0 ]; then \
+        touch conf/conf-enabled/dummy.conf ;\
+    endif
 
 EXPOSE 8080/tcp 8043/tcp
 ENTRYPOINT [ "docker-entrypoint.sh" ]
-- 
cgit v1.2.3