diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..195726ac --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM node:0.12.7 +MAINTAINER Danilo Bargen + +# Choose work directory +WORKDIR /app/ + +# Install node packages +ADD package.json /app/ +RUN npm install + +# Install bower packages +ADD bower.json /app/ +RUN npm install -g bower gulp +RUN bower --allow-root --force-latest install + +# Run gulp tasks +ADD . /app +RUN gulp + +# Add config.json +ADD config.json.docker /app/config.json + +# Entry point +EXPOSE 8080 +CMD ["node", "bin/curvytron.js"] diff --git a/README.md b/README.md index 037e4e19..671f4e8d 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ A web multiplayer Tron game like with curves ## Installation * [Get your local Curvytron server in 1 minute!](doc/installation.md) +* [...or launch a Docker container with the game!](doc/docker.md) --- diff --git a/config.json.docker b/config.json.docker new file mode 100644 index 00000000..a1c32c20 --- /dev/null +++ b/config.json.docker @@ -0,0 +1,11 @@ +{ + "port": 8080, + "googleAnalyticsId": null, + "inspector": { + "enabled": false, + "host": "localhost", + "username": "curvytron", + "password": "curvytron", + "database": "curvytron" + } +} diff --git a/doc/docker.md b/doc/docker.md new file mode 100644 index 00000000..4e70d7fd --- /dev/null +++ b/doc/docker.md @@ -0,0 +1,23 @@ +## Prerequisite + +You need to install Docker. + +## Building an Image + +__Clone the repository__ + + git clone https://github.com/Elao/curvytron.git + cd curvytron + +__Build the docker image__ + + docker build -t yourname/curvytron . + +## Launch server + + docker run -d --name curvytron -p 8080:8080 yourname/curvytron + +## Play + +Go to [http://localhost:8080](http://localhost:8080/) +Join a room, choose a player name and play! diff --git a/doc/installation.md b/doc/installation.md index 787d9efe..def21d5a 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -3,6 +3,8 @@ Curvytron runs on [node.js >= v0.10](https://nodejs.org/). You need to install node on the machine that will run the Curvytron server. +Alternatively, you could also [run Curvytron on Docker](doc/docker.md). + ## Installation __Clone the repository__