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 5753968..d4fa2d8 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 = '034ff213a060a0888230c3934cfb1cb1f80ab3f211a114b713598efac2d1a68f8d3402c6b08ace2f3990c4c029351d1141cf47ebc378fc9a83a5dddda6e38a8c' 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 $@ +