From 55eae7ef6f7e5d097be20ddb692a6ecacfb01039 Mon Sep 17 00:00:00 2001 From: Elijah Cohen Date: Thu, 16 May 2019 17:32:21 -0500 Subject: [PATCH] docker stuff --- .gitignore | 1 + server/.dockerignore | 2 ++ server/Dockerfile | 14 ++++++++++++++ server/constants.js | 2 +- web/main.js | 2 +- 5 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 server/.dockerignore create mode 100644 server/Dockerfile diff --git a/.gitignore b/.gitignore index 2409f5f..825372e 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ server/node_modules/* /server/health.js~ /server/robot.js~ /server/TODO.org~ +/server/Dockerfile~ diff --git a/server/.dockerignore b/server/.dockerignore new file mode 100644 index 0000000..5171c54 --- /dev/null +++ b/server/.dockerignore @@ -0,0 +1,2 @@ +node_modules +npm-debug.log \ No newline at end of file diff --git a/server/Dockerfile b/server/Dockerfile new file mode 100644 index 0000000..4b4907c --- /dev/null +++ b/server/Dockerfile @@ -0,0 +1,14 @@ + +FROM node:12 + +WORKDIR /usr/src/pbr + +COPY package*.json ./ + +RUN npm install + +COPY . . + +EXPOSE 6789 + +CMD [ "npm", "start" ] \ No newline at end of file diff --git a/server/constants.js b/server/constants.js index 733eb02..4a6be0f 100644 --- a/server/constants.js +++ b/server/constants.js @@ -2,7 +2,7 @@ var c = { // matchmaker - WS_PORT: 6789, + WS_PORT: 443, NUM_PLAYERS: 10, FPS: 30, WAIT_TIME: 60000, // 1 minute diff --git a/web/main.js b/web/main.js index be4d700..91ee369 100644 --- a/web/main.js +++ b/web/main.js @@ -1,5 +1,5 @@ -const prefixurl = "ws://" + window.location.hostname + ":6789"; +const prefixurl = "wss://" + window.location.hostname + ":" + c.WS_PORT; var theSocket = null; -- 2.39.2