From: Elijah Cohen Date: Thu, 16 May 2019 22:32:21 +0000 (-0500) Subject: docker stuff X-Git-Url: https://git.eli173.com/?a=commitdiff_plain;h=55eae7ef6f7e5d097be20ddb692a6ecacfb01039;p=pong_br docker stuff --- 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;