From 5f2da859c33deba2656efb74113ef8270884188e Mon Sep 17 00:00:00 2001 From: "Sean P. Kane" Date: Sat, 27 Aug 2022 16:11:36 -0700 Subject: [PATCH 1/2] Assemble static container for multiple platforms --- Dockerfile | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2fcb716..6be39b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,16 @@ -FROM node:9.3-alpine +FROM node:13.13.0-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"] From 93afbc8ff92d52cb8b8e9e5efcebb5539a4d227a Mon Sep 17 00:00:00 2001 From: "Sean P. Kane" Date: Sat, 27 Aug 2022 16:19:42 -0700 Subject: [PATCH 2/2] Update Docker for 2022 --- Dockerfile | 2 +- README.md | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6be39b1..476f401 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:13.13.0-alpine +FROM node:14-alpine RUN mkdir /app WORKDIR /app diff --git a/README.md b/README.md index 52fbdc3..9100f5f 100644 --- a/README.md +++ b/README.md @@ -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.