Compare commits
2 Commits
745ba4d903
...
ed8d35435d
Author | SHA1 | Date | |
---|---|---|---|
ed8d35435d | |||
09b175f88d |
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.git
|
||||||
|
node_modules
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
|||||||
node_modules
|
node_modules
|
||||||
|
17
Dockerfile
Normal file
17
Dockerfile
Normal 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
14
docker-compose.yml
Normal 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
4204
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -23,11 +23,11 @@
|
|||||||
"colors": "^1.4.0",
|
"colors": "^1.4.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"gamedig": "^2.0.23",
|
"gamedig": "^2.0.23",
|
||||||
"markdown-it": "^10.0.0",
|
"markdown-it": "^13.0.1",
|
||||||
"os": "^0.1.1",
|
"os": "^0.1.1",
|
||||||
"socket.io": "^3.0.1",
|
"socket.io": "^4.5.4",
|
||||||
"striptags": "^3.1.1",
|
"striptags": "^3.1.1",
|
||||||
"systeminformation": "^4.16.0"
|
"systeminformation": "^5.15.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^7.13.0",
|
"eslint": "^7.13.0",
|
||||||
|
@ -9,12 +9,15 @@ function handle(req, res) {
|
|||||||
"load": os.loadavg(),
|
"load": os.loadavg(),
|
||||||
"time": si.time()
|
"time": si.time()
|
||||||
};
|
};
|
||||||
si.cpuTemperature(function (data) {
|
si.mem(function (data) {
|
||||||
sysInfo["temp"] = data;
|
|
||||||
});
|
|
||||||
si.mem(function (data) {
|
|
||||||
sysInfo["mem"] = data;
|
sysInfo["mem"] = data;
|
||||||
});
|
});
|
||||||
|
// si.cpuTemperature(function (data) {
|
||||||
|
// sysInfo["temp"] = data;
|
||||||
|
// });
|
||||||
|
// si.mem(function (data) {
|
||||||
|
// sysInfo["mem"] = data;
|
||||||
|
// });
|
||||||
si.fsSize(function (data) {
|
si.fsSize(function (data) {
|
||||||
sysInfo["fs"] = data;
|
sysInfo["fs"] = data;
|
||||||
res.status(200).json(sysInfo);
|
res.status(200).json(sysInfo);
|
||||||
@ -23,4 +26,4 @@ function handle(req, res) {
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
handle
|
handle
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user