feat(*): Update server for deploying

This commit is contained in:
Josh Creek
2023-07-11 17:18:53 +00:00
parent fe8285b06a
commit ba94bdb36b
4 changed files with 30 additions and 1 deletions
+1
View File
@@ -0,0 +1 @@
node_modules
+19
View File
@@ -0,0 +1,19 @@
FROM node:20
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
COPY package*.json ./
RUN npm update
RUN npm install
# If you are building your code for production
# RUN npm ci --only=production
# Bundle app source
COPY . .
EXPOSE 8080
CMD [ "npm", "run", "start" ]
+9
View File
@@ -0,0 +1,9 @@
# Web Sockets Server
## Deploying
Use Docker to deploy this.
Navigate to this folder and run `docker build -t estimation-ws-server .` to build the image.
Run it using `docker run -it --rm -p 8080:8080 estimation-ws-server`
+1 -1
View File
@@ -7,7 +7,7 @@ import { ChangeEstimateMessage } from './classes/messages/ChangeEstimateMessage.
import { SelectEstimateMessage } from './classes/messages/SelectEstimateMessage.js';
const app = express();
const port = process.env.PORT || 3000;
const port = process.env.PORT || 8080;
function onSocketPreError(e: Error) {
console.log(e);