From 0f01dc4d554612428867d02e658383b435d633f0 Mon Sep 17 00:00:00 2001 From: Niek Candaele Date: Tue, 22 Sep 2020 20:18:02 +0200 Subject: [PATCH 1/3] Add basic Docker image --- .dockerignore | 6 ++++++ Dockerfile | 23 +++++++++++++++++++++++ docker-compose.yml | 11 +++++++++++ 3 files changed, 40 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..01de382 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +npm-debug.log +node_modules +*.swp +*.swo +data +*.DS_Store \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8a7e59a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM node:lts-alpine + +RUN mkdir -p /usr/src/app + +WORKDIR /usr/src/app + +COPY . . + +RUN npm run build + +RUN npm install redis@0.8.1 && \ + npm install pg@4.1.1 && \ + npm install memcached@2.2.2 && \ + npm install aws-sdk@2.738.0 && \ + npm install rethinkdbdash@2.3.31 + +ENV HOST 0.0.0.0 + +EXPOSE 7777 +STOPSIGNAL SIGINT +ENTRYPOINT [ "node", "server.js" ] + +CMD ["npm", "start"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3407fbf --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +version: "3.0" +services: + haste-server: + build: . + ports: + - 7777:7777 + volumes: + - haste-data:/usr/src/app/data + +volumes: + haste-data: \ No newline at end of file From 2deac0c101ba4f31b89148aa9bce1ed16bd6fc29 Mon Sep 17 00:00:00 2001 From: niekcandaele <22315101+niekcandaele@users.noreply.github.com> Date: Wed, 21 Oct 2020 10:29:20 +0200 Subject: [PATCH 2/3] Sync docker ignore with gitignore --- .dockerignore | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index 01de382..016abe9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,12 @@ -npm-debug.log node_modules +.vscode +data +data-test + *.swp *.swo -data -*.DS_Store \ No newline at end of file +*.DS_Store + +npm-debug.log +static/*.min.js +config.js \ No newline at end of file From 801bb8046c19997830f0084345b4557311fe749b Mon Sep 17 00:00:00 2001 From: niekcandaele <22315101+niekcandaele@users.noreply.github.com> Date: Wed, 21 Oct 2020 10:29:30 +0200 Subject: [PATCH 3/3] Dont install storage dependencies separately --- Dockerfile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8a7e59a..ee82b35 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,12 +8,6 @@ COPY . . RUN npm run build -RUN npm install redis@0.8.1 && \ - npm install pg@4.1.1 && \ - npm install memcached@2.2.2 && \ - npm install aws-sdk@2.738.0 && \ - npm install rethinkdbdash@2.3.31 - ENV HOST 0.0.0.0 EXPOSE 7777