changeset 14:5643072a1af9

DEP-7: formalize ssdt-utils image. add template preview usas compose file
author smith@nwoca.org
date Sun, 27 Dec 2015 19:24:12 +0000
parents 82b5ed864aee
children 976b754592f4
files compose/preview/usas.yml utils/Dockerfile utils/docker-entrypoint.sh
diffstat 3 files changed, 53 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compose/preview/usas.yml	Sun Dec 27 19:24:12 2015 +0000
@@ -0,0 +1,22 @@
+# base compose file for USAS preview release
+usasdb:
+  restart: always
+  image: docker.ssdt.io/ssdt-postgres:2
+  volumes:
+    - ./backup:/backup
+  environment:
+    - DB_NAME=usasdb
+    - DB_USER=usas
+    - DB_PASS=usasdefault
+usasapp:
+  restart: always
+  image: docker.ssdt.io/usas-app:preview
+  volumes:
+    - ./config:/config
+  links:
+    - usasdb:database
+  environment:
+    - DB_HOST=database
+    - DB_NAME=$${DATABASE_ENV_DB_NAME}
+    - DB_USER=$${DATABASE_ENV_DB_USER}
+    - DB_PASS=$${DATABASE_ENV_DB_PASS}
--- a/utils/Dockerfile	Sun Dec 27 18:00:03 2015 +0000
+++ b/utils/Dockerfile	Sun Dec 27 19:24:12 2015 +0000
@@ -2,9 +2,21 @@
 
 MAINTAINER Dave Smith smith@nwoca.org
 
+ENV SSDT_HOME=/ssdt \
+    SSDT_DOCKER=http://hg.ssdt-ohio.org/public/ssdt-docker/
+
 RUN apt-get update -y
 
 RUN apt-get install -y mercurial \
     && apt-get install -y curl \
     && apt-get install -y vim \
     && apt-get install -y nano
+
+VOLUME /ssdt
+
+COPY ./docker-entrypoint.sh /
+
+RUN chmod a+x ./docker-entrypoint.sh
+
+ENTRYPOINT ["/docker-entrypoint.sh"]
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/utils/docker-entrypoint.sh	Sun Dec 27 19:24:12 2015 +0000
@@ -0,0 +1,19 @@
+#!/bin/bash
+set -e
+
+if [ "$1" = 'update' ]; then
+  cd $SSDT_HOME
+  if [ ! -d ".hg" ]; then
+	  echo "cloning repository $SSDT_DOCKER  to $SSDT_HOME"
+	  mkdir -p $SSDT_HOME
+      hg init
+  fi
+  echo "pulling updates"
+  hg pull -y $SSDT_DOCKER
+  hg update default
+
+else
+
+  exec "$@"
+
+fi
\ No newline at end of file