Add dockerfile
This commit is contained in:
parent
caa060a500
commit
6b6d1bddec
12
dockerfile
Normal file
12
dockerfile
Normal file
@ -0,0 +1,12 @@
|
||||
FROM node:16
|
||||
|
||||
WORKDIR /docker
|
||||
|
||||
COPY package.json ./
|
||||
COPY yarn.lock ./
|
||||
|
||||
RUN yarn
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD ["node", "index.js"]
|
14
index.js
14
index.js
@ -1,12 +1,12 @@
|
||||
const fs = require('fs');
|
||||
const https = require('https');
|
||||
const express = require('express');
|
||||
const socketio = require('socket.io');
|
||||
const fs = require("fs");
|
||||
const https = require("https");
|
||||
const express = require("express");
|
||||
const socketio = require("socket.io");
|
||||
const app = express();
|
||||
|
||||
const https_options = {
|
||||
key: fs.readFileSync('./privkey.pem'),
|
||||
cert: fs.readFileSync('./fullchain.pem'),
|
||||
key: fs.readFileSync("./privkey.pem"),
|
||||
cert: fs.readFileSync("./fullchain.pem"),
|
||||
requestCert: false,
|
||||
rejectUnauthorized: false
|
||||
}
|
||||
@ -33,8 +33,6 @@ io.on("connection", (client) => {
|
||||
io.sockets.emit("update-count", {value: usersConnected});
|
||||
});
|
||||
|
||||
app.use(express.static("src"));
|
||||
|
||||
server.listen(3000, () => {
|
||||
console.log("Server started on port 3000");
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user