From 4b3aebe1400dfa97256f7b2414e48266bd6fc110 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Thu, 31 Oct 2013 21:23:04 -0700 Subject: [PATCH] cleanup base image --- image/Dockerfile | 15 +++------------ launcher | 4 ++-- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/image/Dockerfile b/image/Dockerfile index 7dc77ff..f9981fe 100644 --- a/image/Dockerfile +++ b/image/Dockerfile @@ -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 &&\ diff --git a/launcher b/launcher index 3fc56ef..5f9e37f 100755 --- 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) -- 2.25.1