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",