Move everything to a complete base image
[discourse_docker.git] / image / discourse_dev / Dockerfile
index 8a6c1310df4eda1297e27ec03a9213afdd8f8960..d9a1184b0f93ff95636600b4fb6a07f51124e989 100644 (file)
@@ -1,16 +1,39 @@
-FROM samsaffron/discourse_21:2.1.2.1
+# NAME:     discourse/discourse_dev
+# VERSION:  build
+FROM discourse/base:release
 
 MAINTAINER Sam Saffron "https://twitter.com/samsaffron"
 
-RUN apt-get install -y vim &&\
-      wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2
-RUN tar -xjf phantomjs-1.9.7-linux-x86_64.tar.bz2
-RUN rm phantomjs-1.9.7-linux-x86_64.tar.bz2
-RUN cp phantomjs-1.9.7-linux-x86_64/bin/phantomjs /bin/phantomjs
-RUN rm -fr phantomjs-1.9.7-linux-x86_64
-RUN cd opt && git clone https://github.com/SamSaffron/vim-setup.git
-RUN cd opt/vim-setup && git submodule update --init
-RUN ln -s /opt/vim-setup/vimrc /etc/vim/vimrc.local
-RUN ln -s /opt/vim-setup/vimfiles/bundle /etc/vim/bundle
-RUN apt-get -y install ctags
-RUN apt-get -y install thesilversearcher-ag
+# Install for mailcatcher gem
+RUN apt-get update && apt-get install -y libsqlite3-dev \
+    && gem install mailcatcher && rm -rf /var/lib/apt/lists/*
+
+# Remove the code added on base image
+RUN rm -rf /var/www/*
+
+# Give discourse user no-passwd sudo permissions (for bundle install)
+ADD sudoers.discourse /etc/sudoers.d/discourse
+
+# get redis going
+ADD redis.template.yml /pups/redis.yml
+RUN /pups/bin/pups /pups/redis.yml
+
+RUN locale-gen en_US.UTF-8
+ENV LANG en_US.UTF-8
+ENV LANGUAGE en_US:en
+ENV LC_ALL en_US.UTF-8
+
+# get postgres going
+ADD postgres.template.yml /pups/postgres.yml
+RUN LANG=en_US.UTF-8 /pups/bin/pups /pups/postgres.yml
+
+# add dev databases
+ADD postgres_dev.template.yml /pups/postgres_dev.yml
+RUN /pups/bin/pups /pups/postgres_dev.yml
+
+# move default postgres_data out of the way
+RUN mv /shared/postgres_data /shared/postgres_data_orig
+
+# re-instantiate data on boot if needed (this will allow it to persist across
+# invocations when used with a mounted volume)
+ADD ensure-database /etc/runit/1.d/ensure-database