From 5d473f7c3c9cb6e732895a6da58394e9c8c04901 Mon Sep 17 00:00:00 2001 From: "Sean P. Kane" Date: Wed, 20 Dec 2017 15:13:59 -0800 Subject: [PATCH] Add docker container support --- Dockerfile | 20 ++++++++++++++++++++ README.md | 18 +++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2fcb716 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM node:9.3-alpine + +# If Github throtlling is an issue try building with something like: +# docker build --build-arg JSPM_GITHUB_AUTH_TOKEN="a_jspm_encrypted_github_token" . + +ARG JSPM_GITHUB_AUTH_TOKEN="" +RUN mkdir /app +WORKDIR /app +ADD . /app +RUN apk add --no-cache git && \ + npm install --global karma-cli && \ + npm install jspm -g && \ + jspm config registries.github.auth ${JSPM_GITHUB_AUTH_TOKEN} && \ + npm install http-server -g && \ + npm install && \ + jspm install -y && \ + jspm bundle-sfx --minify app && \ + jspm config registries.github.auth "" +CMD ["http-server",".","-p","8080"] + diff --git a/README.md b/README.md index 50d91fe..14aff35 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ npm install jspm install ``` -Additionally, for development we use `eslint` with `eslint-plugin-lodash`. +Additionally, for development we use `eslint` with `eslint-plugin-lodash`. ## Running server @@ -62,3 +62,19 @@ favicon.ico build.js index.html ``` + +# Docker + +## Building + +`docker build .` +or +`docker build --build-arg JSPM_GITHUB_AUTH_TOKEN="a_jspm_encrypted_github_token" .` + +## Running + +`docker run -d -p 80:8080 ${IMAGE_ID}` +or for a community built image try: +`docker run -d -p 80:8080 spkane/quantum-game:latest` + +and then open up a web browser and point it to port 80 on your Docker host.