Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux container / Docker support (circa 2022) #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 11 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
FROM node:9.3-alpine
FROM node:14-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 ""
COPY package*.json /app
RUN npm config set unsafe-perm true && \
npm install http-server -g && \
npm install
COPY *.svg *.jpg /app/
COPY css/* /app/css/
COPY sounds/* /app/sounds/
COPY favicon.ico /app/
COPY build.js /app/
COPY index.html /app/
CMD ["http-server",".","-p","8080"]

6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,11 @@ Alternatively, you can install dependencies using Docker.

### Building

* You can build this image by running the following command in the root of this repository: `docker build .`
* You can also pass in a valid JSPM_GITHUB_AUTH_TOKEN by building like this: `docker build --build-arg JSPM_GITHUB_AUTH_TOKEN="a_jspm_encrypted_github_token" .`
* For more information see: https://stackoverflow.com/questions/30995040/jspm-saying-github-rate-limit-reached-how-to-fix
* You can assemble a Linux container image by running the following command in the root of this repository: `docker build .`

### Running

* If your build completes sucessfully there will be a new image ID printed at the end of the build, which you can then use to to run it: `docker run -d -p 80:8080 ${IMAGE_ID_FROM_BUILD}`
* If your build completes sucessfully there will be a new image ID or SHA printed at the end of the build, which you can then use to to run it: `docker run -d -p 80:8080 ${IMAGE_ID_FROM_BUILD}`
* or for a community built image try this: `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.