From cd2daf40866eda632ccbf1088955797a0802a1d2 Mon Sep 17 00:00:00 2001 From: Leon Etienne Date: Sun, 10 Apr 2022 04:47:17 +0200 Subject: [PATCH] Dockerified --- .gitignore | 1 + Dockerfile | 21 +++++++++++++++++++++ config.toml | 2 +- entrypoint.sh | 19 +++++++++++++++++++ 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100755 entrypoint.sh diff --git a/.gitignore b/.gitignore index 6081413..8c3a173 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ /node_modules/ *.pem /failed-login-attempts.txt +/docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9268eb1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM node + +# Install the correct npm version +RUN npm install -g n +COPY ./.nvmrc /app/.nvmrc +RUN n install `cat /app/.nvmrc` + +# Install node packages +COPY ./package.json /app/package.json +COPY ./package-lock.json /app/package-lock.json +RUN cd /app && npm install + +# Set up the entry point +WORKDIR /app +COPY ./entrypoint.sh /app/entrypoint.sh +RUN chmod +x /app/entrypoint.sh +ENTRYPOINT ["/app/entrypoint.sh"] + +# Run the server +CMD ["node", "/app/server.js"] + diff --git a/config.toml b/config.toml index 3303ea7..4a70669 100644 --- a/config.toml +++ b/config.toml @@ -5,7 +5,7 @@ # So, if you want to serve relative paths, use: # $WORKING_DIR/relative/path # Paths should NOT end with a '/'! -WEBROOT = '$WORKING_DIR' +WEBROOT = '/var/www/html' # This is the SHA512 digest to check the password against PASSWD_HASH = 'a3c1443b087cf5338d3696f6029fdf791ee4829a27e19c9f257a06ca0d88b5b518ac9868bb13199e807553bda62d3dc15b6354862f34fcab0a7c4c45530349ea' diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..986df35 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# # CD into our application directory +# echo CD into our application directory +# cd /app +# +# # Use the correct node version +# echo Use the correct node version +# npm install -g n +# n install `cat .nvmrc` +# +# # Install all our packages +# echo Install all our packages +# npm install + +# Start the server +echo Start the server +exec $@ +