changeset 1572:2b1b8ebb7d98 dockerise

This now sort-of works, apart from not knowing the db password
author Chris Cannam
date Thu, 03 Aug 2017 17:24:49 +0100
parents 4c2b25b7e85f
children 8edb54e29f00
files extra/soundsoftware/dockertest/Dockerfile
diffstat 1 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/extra/soundsoftware/dockertest/Dockerfile	Thu Aug 03 16:38:41 2017 +0100
+++ b/extra/soundsoftware/dockertest/Dockerfile	Thu Aug 03 17:24:49 2017 +0100
@@ -37,8 +37,9 @@
     rsync \
     ruby \
     ruby-dev \
-    sudo \
-    supervisor
+    sudo
+
+RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
 
 
 # Passenger gets installed through gem, not apt
@@ -62,9 +63,10 @@
 WORKDIR /var/www/code
 
 
-# Set up database config (todo: insert variables)
+# Set up database config etc (todo: insert variables)
 
 RUN cp extra/soundsoftware/dockertest/database.yml config/database.yml
+RUN bundle exec rake generate_secret_token
 
 
 # Install Rails dependencies (database.yml must be populated before this)
@@ -102,10 +104,16 @@
 RUN cp extra/soundsoftware/dockertest/code.conf /etc/apache2/sites-available/
 RUN ln -s ../sites-available/code.conf /etc/apache2/sites-enabled/10-code.conf
 
+RUN apache2ctl configtest
 
-# Start Apache
 
-RUN apache2ctl configtest
+# Start Postgres and foregrounded Apache
+
+RUN echo "#!/bin/bash"                      > container-run.sh
+RUN echo "/etc/init.d/postgresql start"    >> container-run.sh
+RUN echo "apache2ctl -D FOREGROUND"        >> container-run.sh
+RUN chmod +x container-run.sh
+
 EXPOSE 80
-CMD apache2ctl -D FOREGROUND
+CMD ./container-run.sh