cleanup base image
authorSam Saffron <sam.saffron@gmail.com>
Fri, 1 Nov 2013 04:23:04 +0000 (21:23 -0700)
committerSam Saffron <sam.saffron@gmail.com>
Fri, 1 Nov 2013 04:23:04 +0000 (21:23 -0700)
image/Dockerfile
launcher

index 7dc77ff3cb5a7e918c834e1adfcec8d6b3fc2f86..f9981fef8b1c57f0b00861ea9b555272ca4c1ac3 100644 (file)
@@ -39,21 +39,12 @@ RUN apt-get -y update &&\
     mkdir /var/www &&\
     cd /var/www &&\
     git clone https://github.com/discourse/discourse.git &&\
+    chown -R discourse /var/www/discourse &&\
     cd /var/www/discourse &&\
-    RAILS4=1 bundle install &&\
-    cp /var/www/discourse/config/redis.yml.sample /var/www/discourse/config/redis.yml &&\
-    cp /var/www/discourse/config/environments/production.rb.sample /var/www/discourse/config/environments/production.rb
+    sudo -u discourse RAILS4=1 bundle install --deployment &&\
+    apt-get install -y runit
 
 
-RUN apt-get install -y runit &&\
-    mkdir -p /etc/service/sshd &&\
-    mkdir -p /var/run/sshd &&\
-    echo "#!/bin/sh" > /etc/service/sshd/run &&\
-    echo "exec 2>&1" >> /etc/service/sshd/run &&\
-    echo "exec /usr/sbin/sshd -D -e" >> /etc/service/sshd/run &&\
-    mkdir -p /root/.ssh &&\
-    chmod +x /etc/service/sshd/run
-
 # RUN cd /var/www/discourse && bundle exec rake db:test:prepare && bundle exec rspec
 
 # mkdir -p /src/godeb && cd /src/godeb && curl -O https://godeb.s3.amazonaws.com/godeb-amd64.tar.gz &&\
index 3fc56ef9ddea6b9dc112304dd73dc7297f22d3b8..5f9e37f20e8c487e1675240a6a7ccb9b39d2e973 100755 (executable)
--- a/launcher
+++ b/launcher
@@ -35,8 +35,8 @@ case "$command" in
   bootstrap)
       docker run -cidfile $cidbootstrap -i -t -v `pwd`/shared:/shared samsaffron/discourse /shared/pups/bin/pups /$config_file
       docker commit `cat $cidbootstrap` samsaffron/discourse $config
-      docker rm `cat $cidbootstrap`
-      rm $cidbootstrap
+      docker rm `cat $cidbootstrap` && rm $cidbootstrap
+      exit 0
       ;;
 
   ssh)