Update the dockserver Dockerfile to take advantage of the doc/Gemfile,
authorWard Vandewege <ward@clinicalfuture.com>
Tue, 19 Nov 2013 17:22:17 +0000 (12:22 -0500)
committerWard Vandewege <ward@clinicalfuture.com>
Tue, 19 Nov 2013 17:22:17 +0000 (12:22 -0500)
as well as the fact that locale generation and the DEBIAN_FRONTEND
environment variable are now set in the base container.

docker/docserver/Dockerfile
docker/docserver/apache2_foreground.sh [new file with mode: 0755]

index 4ab17eed9d0cef29a61b6362aa863c20ad809cc5..525123e70ccf6de2c627e5f51310f047be06c5ea 100644 (file)
@@ -3,20 +3,15 @@
 FROM arvados/base
 maintainer Ward Vandewege <ward@clinicalfuture.com>
 
-env DEBIAN_FRONTEND noninteractive
-
 # Install packages
 # Fix Locale
 # Build static site
-
 RUN /bin/mkdir -p /usr/src/arvados
 ADD generated/doc.tar.gz /usr/src/arvados/
 RUN \
     apt-get update ;\
-    apt-get install -q -y curl procps apache2-mpm-worker locales ;\
-    /bin/sed -ri 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen ;\
-    /usr/sbin/locale-gen ;\
-    gem install jekyll RedCloth ;\
+    apt-get install -q -y curl procps apache2-mpm-worker ;\
+    bundle install --gemfile=/usr/src/arvados/doc/Gemfile ;\
     /bin/sed -ri 's/^baseurl: .*$/baseurl: /' /usr/src/arvados/doc/_config.yml ;\
     cd /usr/src/arvados/doc; LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" jekyll build
 
@@ -26,13 +21,7 @@ RUN \
   a2dissite default ;\
   a2ensite doc
 
-# Finally, start Apache
-env APACHE_RUN_USER    www-data
-env APACHE_RUN_GROUP   www-data
-env APACHE_PID_FILE    /var/run/apache2.pid
-env APACHE_RUN_DIR     /var/run/apache2
-env APACHE_LOCK_DIR    /var/lock/apache2
-env APACHE_LOG_DIR     /var/log/apache2
-env LANG               C
+ADD apache2_foreground.sh /etc/apache2/foreground.sh
 
-cmd ["/usr/sbin/apache2", "-D", "FOREGROUND"]
+# Start Apache
+CMD ["/etc/apache2/foreground.sh"]
diff --git a/docker/docserver/apache2_foreground.sh b/docker/docserver/apache2_foreground.sh
new file mode 100755 (executable)
index 0000000..fc6028e
--- /dev/null
@@ -0,0 +1,7 @@
+#! /bin/bash
+
+read pid cmd state ppid pgrp session tty_nr tpgid rest < /proc/self/stat
+trap "kill -TERM -$pgrp; exit" EXIT TERM KILL SIGKILL SIGTERM SIGQUIT
+
+source /etc/apache2/envvars
+/usr/sbin/apache2 -D FOREGROUND