From 59247693b54baef80c4597a27fc4ec55d9b73014 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 3 Nov 2013 00:49:42 +0000 Subject: [PATCH] Initial commit --- Dockerfile | 36 ++++++++++++++++++++++++++++++++++++ README.md | 10 ++++++++++ 2 files changed, 46 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0f4069a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +# emdr-relay-go +# +# Basic container to run a EMDR Relay instance. + +# Base on Ubuntu +FROM ubuntu:quantal + +# Add some sane options to Apt/Dpkg +ENV DEBIAN_FRONTEND noninteractive +RUN echo "APT::Get::Install-Recommends \"0\";" >> /etc/apt/apt.conf.d/99local +RUN echo "APT::Get::Install-Suggests \"0\";" >> /etc/apt/apt.conf.d/99local +RUN echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | tee /etc/apt/apt.conf.d/no-cache + +# Grab build deps +RUN echo "deb http://archive.ubuntu.com/ubuntu quantal universe" > /etc/apt/sources.list.d/universe.list +RUN apt-get -qq update +RUN apt-get install -y golang libzmq-dev uuid-dev libtool mercurial git supervisor pkg-config + +# Pull Go deps +RUN go get github.com/alecthomas/gozmq +RUN go get code.google.com/p/vitess/go/cache + +# Setup the emdr user +RUN useradd --home /home/emdr --create-home --system emdr + +# Grab the code +RUN cd /home/emdr/ && git clone https://github.com/gtaylor/emdr-relay-go.git +RUN cd /home/emdr/emdr-relay-go && go build emdr-relay-go.go + +# Copy configs +RUN cp /home/emdr/emdr-relay-go/example_configs/supervisord-relay.conf /etc/supervisor/conf.d/emdr-relay-go.conf +RUN cp /home/emdr/emdr-relay-go/example_configs/example.cron.daily /etc/cron.daily/emdr-relay-go && chmod a+x /etc/cron.daily/emdr-relay-go + +# Expose ports and set initial run command +EXPOSE 8050 +CMD /usr/bin/supervisord -n \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..1412d9f --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +emdr-relay-go-docker +==================== + +Simple Dockerfile to build a EMDR Relay from the current github code. + +Todo +---- + +* Pull/update on container boot, ensuring the latest code. +* Setup a working cron setup for restarts, to avoid DNS oddities. \ No newline at end of file