summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-02-21 20:44:41 +0100
committerSuren A. Chilingaryan <csa@suren.me>2018-02-21 20:44:41 +0100
commit0f86d4f7d5b0bb2c64d8adefa4dd93a2a5506c11 (patch)
treeb0cc55b472874a4ec13b71c9e3f784031aa905ea
parent350abf69de17b079c7589022bb0b2df01a51f84e (diff)
downloadadei-0f86d4f7d5b0bb2c64d8adefa4dd93a2a5506c11.tar.gz
adei-0f86d4f7d5b0bb2c64d8adefa4dd93a2a5506c11.tar.bz2
adei-0f86d4f7d5b0bb2c64d8adefa4dd93a2a5506c11.tar.xz
adei-0f86d4f7d5b0bb2c64d8adefa4dd93a2a5506c11.zip
Allow container to run in unpriviledged mode
-rw-r--r--adei/Dockerfile6
-rwxr-xr-xadei/scripts/run-apache.sh16
2 files changed, 17 insertions, 5 deletions
diff --git a/adei/Dockerfile b/adei/Dockerfile
index ab38acf..523e3c5 100644
--- a/adei/Dockerfile
+++ b/adei/Dockerfile
@@ -18,6 +18,7 @@ RUN zypper ar http://download.opensuse.org/repositories/home:/csa7fff:/adei/open
zypper -n in make java && \
zypper -n in adei adei-config-default adei-req-mssql adei-webroot
+VOLUME /var/run
VOLUME /var/log/apache2
VOLUME /var/spool/mail
@@ -40,8 +41,11 @@ RUN rm -rf /srv/www/htdocs/adei && \
ln -s /adei/src /srv/www/htdocs/adei
RUN ln -sf /etc/mime.types /etc/apache2/mime.types && \
+ find /etc/apache2 -type d -exec chmod +rx '{}' \; && \
+ chmod -R +r /etc/apache2 && \
mv /etc/apache2 /opt/ && \
- ln -s /adei/ovr/apache2 /etc/apache2
+ ln -s /adei/ovr/apache2 /etc/apache2 && \
+ chmod +x /usr/sbin/start_apache2
ENV MYSQL_SERVER adei-mysql
ENV MYSQL_PORT 3306
diff --git a/adei/scripts/run-apache.sh b/adei/scripts/run-apache.sh
index 90438a7..1db3397 100755
--- a/adei/scripts/run-apache.sh
+++ b/adei/scripts/run-apache.sh
@@ -15,12 +15,19 @@ LOCK_FILE=.lock
fi
) 10> /adei/cfg/$LOCK_FILE
-sed -i'' -re '/Listen/ { /(80|443)/!d }' /etc/apache2/listen.conf
+#Keep 80 & 443
+#sed -i'' -re '/Listen/ { /(80|443)/!d }' /etc/apache2/listen.conf
+#if [ -n "$ADEI_PORTS" ]; then
+# for port in $ADEI_PORTS; do
+# [ $port -eq 80 ] && continue
+# [ $port -eq 443 ] && continue
+# echo "Listen $port" >> /etc/apache2/listen.conf
+# done
+#fi
+
if [ -n "$ADEI_PORTS" ]; then
+ echo -n "" > /etc/apache2/listen.conf
for port in $ADEI_PORTS; do
- [ $port -eq 80 ] && continue
- [ $port -eq 443 ] && continue
-
echo "Listen $port" >> /etc/apache2/listen.conf
done
fi
@@ -48,4 +55,5 @@ if [ -n "$APACHE_SERVERS" -a "$APACHE_SERVERS" -ne 0 ]; then
[ $max_spare -eq 0 ] || sed -i'' -re "s/MaxSpareServers(.*)/MaxSpareServers $max_spare/" /etc/apache2/server-tuning.conf
fi
+rm -f /var/run/httpd.pid
/usr/sbin/apache2ctl start -D FOREGROUND