Add dockerfile

This commit is contained in:
Quentin ANIERE 2022-04-09 00:32:32 +02:00
parent caa060a500
commit 6b6d1bddec
3 changed files with 668 additions and 8 deletions

12
dockerfile Normal file
View File

@ -0,0 +1,12 @@
FROM node:16
WORKDIR /docker
COPY package.json ./
COPY yarn.lock ./
RUN yarn
COPY . .
CMD ["node", "index.js"]

View File

@ -1,12 +1,12 @@
const fs = require('fs'); const fs = require("fs");
const https = require('https'); const https = require("https");
const express = require('express'); const express = require("express");
const socketio = require('socket.io'); const socketio = require("socket.io");
const app = express(); const app = express();
const https_options = { const https_options = {
key: fs.readFileSync('./privkey.pem'), key: fs.readFileSync("./privkey.pem"),
cert: fs.readFileSync('./fullchain.pem'), cert: fs.readFileSync("./fullchain.pem"),
requestCert: false, requestCert: false,
rejectUnauthorized: false rejectUnauthorized: false
} }
@ -33,8 +33,6 @@ io.on("connection", (client) => {
io.sockets.emit("update-count", {value: usersConnected}); io.sockets.emit("update-count", {value: usersConnected});
}); });
app.use(express.static("src"));
server.listen(3000, () => { server.listen(3000, () => {
console.log("Server started on port 3000"); console.log("Server started on port 3000");
}); });

650
yarn.lock Normal file

File diff suppressed because it is too large Load Diff