From 412739e1185be6a9d8a50423904dce0d42995cd2 Mon Sep 17 00:00:00 2001 From: pulpo Date: Tue, 31 Mar 2020 12:06:38 -0300 Subject: [PATCH] Remove tls and added Dockerfile --- Dockerfile | 19 +++++++++++++++++++ src/bin/www | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4bc0727 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM node:slim as base +COPY src /app/src +RUN apt update && apt install -yqq curl gnupg2 && curl install.zerotier.com | bash && cd /var/lib/zerotier-one/ && rm authtoken.secret planet zerotier-one.pid zerotier-one.port identity.secret identity.public + +FROM base as dependencies +WORKDIR /app/src +RUN apt-get install -y build-essential python3 && npm install -g node-gyp && npm install + +FROM base as runtime +COPY src /app/ +COPY --from=dependencies /app/src/node_modules /app/src/node_modules +EXPOSE 3000 +RUN mv /app/src/etc/default.passwd /app/src/etc/passwd +WORKDIR /app/src/ +CMD zerotier-one -d && npm start + +# TODO +# - remove cache and trash + diff --git a/src/bin/www b/src/bin/www index 56fe4da..0faa7b8 100755 --- a/src/bin/www +++ b/src/bin/www @@ -11,8 +11,8 @@ const https = require('https'); const fs = require('fs'); const options = { - cert: fs.readFileSync('etc/tls/fullchain.pem'), - key: fs.readFileSync('etc/tls/privkey.pem') +// cert: fs.readFileSync('etc/tls/fullchain.pem'), +// key: fs.readFileSync('etc/tls/privkey.pem') } /**