| 1 | # NAME: discourse/discourse_dev |
| 2 | # VERSION: 1.3.9 |
| 3 | FROM discourse/base:1.3.9 |
| 4 | |
| 5 | MAINTAINER Sam Saffron "https://twitter.com/samsaffron" |
| 6 | |
| 7 | # Install for mailcatcher gem |
| 8 | RUN apt-get update && apt-get install -y libsqlite3-dev \ |
| 9 | && gem install mailcatcher && rm -rf /var/lib/apt/lists/* |
| 10 | |
| 11 | # Create discourse user and /var/www location for both |
| 12 | # discourse and dev images. |
| 13 | RUN useradd discourse -s /bin/bash -m -U &&\ |
| 14 | mkdir -p /var/www |
| 15 | |
| 16 | # Give discourse user no-passwd sudo permissions (for bundle install) |
| 17 | ADD sudoers.discourse /etc/sudoers.d/discourse |
| 18 | |
| 19 | # get redis going |
| 20 | ADD redis.template.yml /pups/redis.yml |
| 21 | RUN /pups/bin/pups /pups/redis.yml |
| 22 | |
| 23 | RUN locale-gen en_US.UTF-8 |
| 24 | ENV LANG en_US.UTF-8 |
| 25 | ENV LANGUAGE en_US:en |
| 26 | ENV LC_ALL en_US.UTF-8 |
| 27 | |
| 28 | # get postgres going |
| 29 | ADD postgres.template.yml /pups/postgres.yml |
| 30 | RUN LANG=en_US.UTF-8 /pups/bin/pups /pups/postgres.yml |
| 31 | |
| 32 | # add dev databases |
| 33 | ADD postgres_dev.template.yml /pups/postgres_dev.yml |
| 34 | RUN /pups/bin/pups /pups/postgres_dev.yml |
| 35 | |
| 36 | # move default postgres_data out of the way |
| 37 | RUN mv /shared/postgres_data /shared/postgres_data_orig |
| 38 | |
| 39 | # re-instantiate data on boot if needed (this will allow it to persist across |
| 40 | # invocations when used with a mounted volume) |
| 41 | ADD ensure-database /etc/runit/1.d/ensure-database |