add docker stuff | edit something

This commit is contained in:
lucaspalomodevelop 2022-06-01 21:20:41 +02:00
parent 87a9aaa196
commit 8694ced81d
8 changed files with 29 additions and 9 deletions

View File

@ -1,7 +1,7 @@
{
"webserver":{
"port":8080,
"host":"localhost",
"host":"127.0.0.1",
"caching":false
},
"jsste":{

8
docker-compose.yml Normal file
View File

@ -0,0 +1,8 @@
version: '3'
services:
jsste:
build: .
volumes:
- ./:/app
ports:
- "8080:8080"

10
dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM node:18
COPY . /app
WORKDIR /app
RUN npm install
WORKDIR /app/dashboard
RUN npm install
RUN npm run build
WORKDIR /app
EXPOSE 8080
CMD ["npm", "start"]

View File

@ -25,9 +25,7 @@ function updateData() {
console.log = function (d) {
name = "log_" + moment().format("YYYY-MM-DD") + ".log";
d = `[ ${moment().format(
"YYYY-MM-DD HH:mm:ss"
)}] [${currentuuid}] ${util.format(d)} \n`;
d = `[ ${moment().format("YYYY-MM-DD HH:mm:ss")}] ${util.format(d)} \n`;
log_file.write(d);
log_stdout.write(d);
};

View File

@ -1,4 +1,4 @@
let JssteState = { statusMSG: "could not started JSSTE", status: 1 };
let JssteState = { statusMSG: "could not started JSSTE", status: 1, pageStatus:[] };
let WebsrvState = { port: undefined, status: undefined };
module.exports = {

View File

@ -5,7 +5,7 @@ let jobs = require("./helper/cronjobs");
let open = require("open");
let os = require("os");
os.setPriority(os.constants.priority.PRIORITY_HIGHEST);
//os.setPriority(os.constants.priority.PRIORITY_HIGHEST);
/**
* @description

View File

@ -8,6 +8,10 @@ app.specialvars = function (variable_regex, cb, instance = app.instance) {};
* @param {*} pagecode
* @param {*} templatecode
*/
app.render = function (pagecode, templatecode) {};
app.render = function (pagecode, templatecode) {
};
module.exports = app;

View File

@ -26,9 +26,9 @@ module.exports = function (conf) {
app.use(bodyParser.json());
app.use(cookieParser());
app.use("/api", internalRouter);
app.use("/dashboard", express.static(__dirname + "/../../dashboard"));
app.use("/dashboard", express.static(__dirname + "/../../dashboard/build"));
app.get("/dashboard/*", (req, res) => {
let indexPath = path.join(__dirname + "/../../dashboard/index.html");
let indexPath = path.join(__dirname + "/../../dashboard/build/index.html");
res.sendFile(indexPath);
});