From 3982aac8453999d3ef2865af6b6fd861b8639738 Mon Sep 17 00:00:00 2001 From: Ben Evans Date: Fri, 25 Sep 2015 18:34:27 +0100 Subject: [PATCH 1/3] Add a Dockerfile Building: docker build -t shout . Running: docker run --name shout -d --publish 9000:9000 shout --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..2e5e170c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM node:0.12-onbuild +EXPOSE 9000 +ENTRYPOINT ./index.js From 7c54a97fad9822c5f7534fabb3c2868f011f0b79 Mon Sep 17 00:00:00 2001 From: Ben Evans Date: Tue, 29 Sep 2015 00:24:47 +0100 Subject: [PATCH 2/3] Expressive Entrypoint in Dockerfile Updated to https://github.com/erming/shout/pull/477#issuecomment-143636577 comment --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2e5e170c..4c90e25d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,3 @@ FROM node:0.12-onbuild EXPOSE 9000 -ENTRYPOINT ./index.js +ENTRYPOINT ["node", "index.js"] From 5d8669112de73a3c60aa0b557aa9cea438032d0d Mon Sep 17 00:00:00 2001 From: Ben Evans Date: Sat, 24 Oct 2015 20:45:44 +0100 Subject: [PATCH 3/3] Added @Xe's tips on the Dockerfile https://github.com/Shuo-IRC/Shuo/pull/87 --- Dockerfile | 26 ++++++++++++++++++++++++-- docker-compose.yml | 4 ++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile index 4c90e25d..f4de8984 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,25 @@ -FROM node:0.12-onbuild +# +# Thanks to @Xe for the Dockerfile template +# https://github.com/Shuo-IRC/Shuo/pull/87/files +# + +FROM node:4.0-onbuild + +# Create a non-root user for shout to run in. +RUN useradd --create-home shout + +# Needed for setup of Node.js +ENV HOME /home/shout + +# Customize this to specify where Shout puts its data. +# To link a data container, have it expose /home/shout/data +ENV SHOUT_HOME /home/shout/data + +# Expose HTTP EXPOSE 9000 -ENTRYPOINT ["node", "index.js"] + +# Drop root. +USER shout + +# Don't use an entrypoint here. It makes debugging difficult. +CMD node index.js --home $SHOUT_HOME diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..44e6ab81 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,4 @@ +shout: + build: . + ports: + - "9000:9000"