diff --git a/examples/nodejs-simple/Dockerfile b/examples/nodejs-simple/Dockerfile index 83eed6ba86..a012f0046f 100644 --- a/examples/nodejs-simple/Dockerfile +++ b/examples/nodejs-simple/Dockerfile @@ -35,9 +35,12 @@ RUN apt-get update && apt-get install -y nodejs WORKDIR /home/server +COPY ./sdks/nodejs sdks/nodejs +RUN cd sdks/nodejs && \ + npm ci --production COPY ./examples/nodejs-simple examples/nodejs-simple RUN cd examples/nodejs-simple && \ - npm install && npm rebuild + npm ci --production RUN chown -R server /home/server USER 1000 diff --git a/examples/nodejs-simple/Makefile b/examples/nodejs-simple/Makefile index 19c77fcaf0..88119dd762 100644 --- a/examples/nodejs-simple/Makefile +++ b/examples/nodejs-simple/Makefile @@ -28,7 +28,7 @@ REPOSITORY = gcr.io/agones-images # Directory that this Makefile is in. mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) project_path := $(dir $(mkfile_path)) -server_tag = $(REPOSITORY)/nodejs-simple-server:0.7 +server_tag = $(REPOSITORY)/nodejs-simple-server:0.8 root_path = $(realpath $(project_path)/../..) # _____ _ diff --git a/examples/nodejs-simple/README.md b/examples/nodejs-simple/README.md index 5b9a910625..1912618fc3 100644 --- a/examples/nodejs-simple/README.md +++ b/examples/nodejs-simple/README.md @@ -42,7 +42,7 @@ $ make run The example can also be run via docker: ``` -$ docker run --network=host gcr.io/agones-images/nodejs-simple-server:0.6 +$ docker run --network=host gcr.io/agones-images/nodejs-simple-server:0.8 ``` Or directly via npm: ``` @@ -51,7 +51,7 @@ $ npm start You will see the output like the following: ``` -docker run --network=host gcr.io/agones-images/nodejs-simple-server:0.6 +docker run --network=host gcr.io/agones-images/nodejs-simple-server:0.8 > @ start /home/server/examples/nodejs-simple > node src/index.js @@ -63,7 +63,7 @@ Connecting to the SDK server... To see help, pass `--help` as the argument (use the preferred command below, all are equivalent): ``` $ make args="--help" run -$ docker run --network=host gcr.io/agones-images/nodejs-simple-server:0.6 --help +$ docker run --network=host gcr.io/agones-images/nodejs-simple-server:0.8 --help $ npm start -- --help ``` @@ -71,14 +71,14 @@ You can optionally specify how long the server will stay up once the basic tests To do this pass arguments through, e.g. to increase the shutdown duration to 120 seconds: ``` $ make args="--timeout=120" run -$ docker run --network=host gcr.io/agones-images/nodejs-simple-server:0.6 --timeout=120 +$ docker run --network=host gcr.io/agones-images/nodejs-simple-server:0.8 --timeout=120 $ npm start -- --timeout=120 ``` To make run indefinitely use the special timeout value of 0: ``` $ make args="--timeout=0" run -$ docker run --network=host gcr.io/agones-images/nodejs-simple-server:0.6 --timeout=0 +$ docker run --network=host gcr.io/agones-images/nodejs-simple-server:0.8 --timeout=0 $ npm start -- --timeout=0 ``` @@ -90,6 +90,6 @@ $ cd ../../build; make run-sdk-conformance-local TIMEOUT=120 FEATURE_GATES="Play Then enable the alpha suite: ``` $ make args="--alpha" run -$ docker run --network=host gcr.io/agones-images/nodejs-simple-server:0.6 --alpha +$ docker run --network=host gcr.io/agones-images/nodejs-simple-server:0.8 --alpha $ npm start -- --alpha ``` diff --git a/examples/nodejs-simple/gameserver.yaml b/examples/nodejs-simple/gameserver.yaml index 1315c4439b..3cac55687c 100644 --- a/examples/nodejs-simple/gameserver.yaml +++ b/examples/nodejs-simple/gameserver.yaml @@ -32,5 +32,5 @@ spec: spec: containers: - name: nodejs-simple - image: gcr.io/agones-images/nodejs-simple-server:0.6 + image: gcr.io/agones-images/nodejs-simple-server:0.8 # args: ["--timeout=0"] # Change the timeout here, if you like the nodejs server to run longer.