changeset 1569:26a4f99ec679 dockerise

Experimenting with Docker setup
author Chris Cannam
date Wed, 02 Aug 2017 18:59:22 +0100
parents 3ad53f43483d
children ae2f71010562
files .dockerignore extra/soundsoftware/dockertest/Dockerfile extra/soundsoftware/dockertest/start.sh
diffstat 3 files changed, 54 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.dockerignore	Wed Aug 02 18:59:22 2017 +0100
@@ -0,0 +1,3 @@
+.dockerignore
+.hg
+extra/soundsoftware/dockertest/Dockerfile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/dockertest/Dockerfile	Wed Aug 02 18:59:22 2017 +0100
@@ -0,0 +1,37 @@
+FROM ubuntu:16.04
+MAINTAINER Chris Cannam <cannam@all-day-breakfast.com>
+RUN apt-get update && \
+    apt-get install -y \
+    build-essential \
+    git mercurial \
+    curl wget rsync libcurl4-openssl-dev \
+    logrotate cron \
+    apache2 apache2-dev libapr1-dev libaprutil1-dev \
+    ruby ruby-dev \
+    postgresql libpq-dev \
+    openjdk-9-jdk-headless \
+    libapache2-mod-perl2 \
+    imagemagick libmagickwand-dev graphviz \
+    doxygen \
+    exim4
+RUN groupadd code
+RUN useradd -g code -G www-data code
+RUN gem install passenger -v 4.0.60 --no-rdoc --no-ri
+RUN passenger-install-apache2-module --languages=ruby
+COPY . /var/www/code
+RUN chown -R code.www-data /var/www/code
+RUN find /var/www/code -type d -exec chmod g+x \{\} \;
+WORKDIR /var/www/code
+RUN echo \
+'production:\n\
+  adapter: postgresql\n\
+  database: code\n\
+  host: localhost\n\
+  username: code\n\
+  password: "example"\n' | sed 's/\\n/\n/g' > config/database.yml
+RUN gem install bundler
+RUN bundle install
+RUN ps auxw|grep postgres
+RUN apt-get install sudo
+RUN chown postgres postgres-dumpall
+RUN /etc/init.d/postgresql start && sudo -u postgres psql -f postgres-dumpall postgres
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/dockertest/start.sh	Wed Aug 02 18:59:22 2017 +0100
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+set -eu
+
+dockerdir=./extra/soundsoftware/dockertest
+if [ ! -d "$dockerdir" ]; then
+    echo "Run this script from the root of a working copy of soundsoftware-site"
+    exit 2
+fi
+
+dockertag="cannam/soundsoftware-site"
+
+sudo docker build -t "$dockertag" -f "$dockerdir/Dockerfile" .
+