From edd9d5c15ad646b74425f26f8a2d7249d87259c3 Mon Sep 17 00:00:00 2001 From: Nathan DECHER Date: Tue, 7 Apr 2020 20:09:02 +0200 Subject: [PATCH] added Dockerfile (closes #27) --- Dockerfile | 3 +++ README.md | 10 ++++------ 2 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f39927f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine:3.11.5 +RUN apk add --no-cache nodejs npm git imagemagick make && git clone https://gitdab.com/Codinget/Snek /snek && cd /snek && npm i && make && apk del git make imagemagick && printf '#!/bin/sh\ncd /snek\nnpm start\n' > start.sh && chmod +x start.sh +CMD /snek/start.sh diff --git a/README.md b/README.md index f838cb1..4f64100 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,7 @@ A "simple" Snake, done as my final JS class project - Node.js 10 and 12 are known to work ## Running the game -- Clone this repository -- Install the npm dependencies (`npm install`) -- Generate the assets, stylesheets and scripts (`make`) -- Start the webserver (`npm start`) -- The server listens on port 3000 on all available addresses - +- Get the Dockerfile +- `docker build` it +- `docker run -p80:3000 ` +- ideally, put it behind a reverse proxy