Compare commits

...

2 Commits

Author SHA1 Message Date
Arne van Iterson ed8d35435d Synology changes 2024-02-08 13:20:51 +01:00
Arne van Iterson 09b175f88d Docker setup 2024-02-08 11:56:05 +01:00
7 changed files with 3365 additions and 893 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
.git
node_modules

2
.gitignore vendored
View File

@ -1 +1 @@
node_modules
node_modules

17
Dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM node:18-alpine as base
WORKDIR /src
COPY package*.json /
EXPOSE 2428
FROM base as production
ENV NODE_ENV=production
RUN npm ci
COPY . /
CMD ["node", "bin/www"]
FROM base as dev
ENV NODE_ENV=development
RUN npm install -g nodemon && npm install
COPY . /
CMD ["nodemon", "bin/www"]

14
docker-compose.yml Normal file
View File

@ -0,0 +1,14 @@
version: '3.8'
services:
web:
build:
context: ./
target: dev
volumes:
- .:/src
command: npm run start:dev
ports:
- "2428:2428"
environment:
NODE_ENV: development
DEBUG: nodejs-docker-express:*

4204
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -23,11 +23,11 @@
"colors": "^1.4.0",
"express": "^4.17.1",
"gamedig": "^2.0.23",
"markdown-it": "^10.0.0",
"markdown-it": "^13.0.1",
"os": "^0.1.1",
"socket.io": "^3.0.1",
"socket.io": "^4.5.4",
"striptags": "^3.1.1",
"systeminformation": "^4.16.0"
"systeminformation": "^5.15.1"
},
"devDependencies": {
"eslint": "^7.13.0",

View File

@ -9,12 +9,15 @@ function handle(req, res) {
"load": os.loadavg(),
"time": si.time()
};
si.cpuTemperature(function (data) {
sysInfo["temp"] = data;
});
si.mem(function (data) {
si.mem(function (data) {
sysInfo["mem"] = data;
});
// si.cpuTemperature(function (data) {
// sysInfo["temp"] = data;
// });
// si.mem(function (data) {
// sysInfo["mem"] = data;
// });
si.fsSize(function (data) {
sysInfo["fs"] = data;
res.status(200).json(sysInfo);
@ -23,4 +26,4 @@ function handle(req, res) {
module.exports = {
handle
};
};