[odrs-web] Move the vhost to its own directory to avoid sed permissions problems under /etc/httpd/conf.d



commit bb2c34e330a640d1dbabaea25d597216c646c2bc
Author: Andrea Veri <averi redhat com>
Date:   Mon Dec 17 12:25:07 2018 +0100

    Move the vhost to its own directory to avoid sed permissions problems under /etc/httpd/conf.d

 Dockerfile    | 8 ++++++--
 entrypoint.sh | 8 ++++----
 2 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/Dockerfile b/Dockerfile
index 8d31282..5a7b17c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -12,13 +12,17 @@ WORKDIR ${ODRS_HOME}
 
 COPY app_data ${ODRS_HOME}
 
-COPY odrs.gnome.org.conf /etc/httpd/conf.d/odrs.gnome.org.conf
-RUN rm /etc/httpd/conf.d/welcome.conf
+RUN mkdir /etc/httpd/sites.d && \
+    echo 'IncludeOptional sites.d/*.conf' >> /etc/httpd/conf/httpd.conf && \
+    rm /etc/httpd/conf.d/welcome.conf
+
+COPY odrs.gnome.org.conf /etc/httpd/sites.d/odrs.gnome.org.conf
 
 RUN python /opt/app-root/src/cron.py ratings /opt/app-root/src/app/static/ratings.json 
 
 RUN chown -R 1000310000:0 ${ODRS_HOME} && \
     chmod -R 664 ${ODRS_HOME} && \
+    chown -R 1000310000:0 /etc/httpd/sites.d && \
     find ${ODRS_HOME} -type d -exec chmod 775 {} +
 
 COPY entrypoint.sh /usr/local/bin
diff --git a/entrypoint.sh b/entrypoint.sh
index 9f3b21d..65835d8 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -1,9 +1,9 @@
 #!/bin/sh
 
-sed -i "s/replace_odrs_secret/${ODRS_REVIEWS_SECRET}/" /etc/httpd/conf.d/odrs.gnome.org.conf
-sed -i "s/replace_odrs_username/${MYSQL_DB_USERNAME}/" /etc/httpd/conf.d/odrs.gnome.org.conf
-sed -i "s/replace_odrs_password/${MYSQL_DB_PASSWORD}/" /etc/httpd/conf.d/odrs.gnome.org.conf
-sed -i "s/replace_odrs_host/${MYSQL_DB_HOST}/" /etc/httpd/conf.d/odrs.gnome.org.conf
+sed -i "s/replace_odrs_secret/${ODRS_REVIEWS_SECRET}/" /etc/httpd/sites.d/odrs.gnome.org.conf
+sed -i "s/replace_odrs_username/${MYSQL_DB_USERNAME}/" /etc/httpd/sites.d/odrs.gnome.org.conf
+sed -i "s/replace_odrs_password/${MYSQL_DB_PASSWORD}/" /etc/httpd/sites.d/odrs.gnome.org.conf
+sed -i "s/replace_odrs_host/${MYSQL_DB_HOST}/" /etc/httpd/sites.d/odrs.gnome.org.conf
 
 while true; do python /opt/app-root/src/cron.py ratings /opt/app-root/src/app/static/ratings.json ; sleep 
43200 ; done &
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]