From e09b3ee92fca12bb562c9d1014518b27e95b5421 Mon Sep 17 00:00:00 2001 From: Hexagon Date: Sun, 15 Jan 2017 00:47:20 +0100 Subject: [PATCH] Added entrypoint (docker) --- Dockerfile | 4 ++-- docker-entrypoint.sh | 9 +++++++++ package.json | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 docker-entrypoint.sh diff --git a/Dockerfile b/Dockerfile index c66da05..2829024 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM node:alpine RUN mkdir -p /usr/src/app/public -VOLUME /usr/src/app/public WORKDIR /usr/src/app COPY . /usr/src/app RUN npm install EXPOSE 8080 -CMD [ "npm", "start" ] +ENTRYPOINT [ "docker-entrypoint.sh" ] +CMD [ "npm", "start"] \ No newline at end of file diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..6d22238 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -e + +if [ ! -e '/usr/src/app/external-public/index.html' ]; then + cp -R /usr/src/app/public /usr/src/app/external-public + chown -R www-data /usr/src/app/external-public +fi + +exec "$@" \ No newline at end of file diff --git a/package.json b/package.json index 9f4f74c..3c05f4e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name" : "cryptalk", - "version" : "1.1.8", + "version" : "1.1.9", "description" : "Encrypted HTML5/Node.JS instant chat", "main" : "server.js", "subdomain": "cryptalk",