Updated Nubian to run in a docker composition
This commit is contained in:
parent
ea2cefb8f3
commit
9b964af050
5 changed files with 10 additions and 6 deletions
|
@ -1,9 +1,10 @@
|
||||||
FROM node:latest
|
FROM node:latest
|
||||||
RUN apt-get update && apt-get upgrade -y
|
RUN apt-get update && apt-get upgrade -y
|
||||||
WORKDIR /dunestorm/nubian
|
WORKDIR /dunestorm/nubian
|
||||||
COPY src /dunestorm/nubian
|
COPY package.json /dunestorm/nubian/
|
||||||
|
COPY src /dunestorm/nubian/src
|
||||||
RUN npm i
|
RUN npm i
|
||||||
|
|
||||||
CMD ["npm","start"]
|
CMD ["npm","start"]
|
||||||
# EXPOSE PORTS
|
# EXPOSE PORTS
|
||||||
EXPOSE 4001
|
EXPOSE 52001
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"description": "Dunemask Web server",
|
"description": "Dunemask Web server",
|
||||||
"main": "server.js",
|
"main": "server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node server.js --no-warnings",
|
"start": "node src/server.js --no-warnings",
|
||||||
"test-server": "nodemon src/server.js"
|
"test-server": "nodemon src/server.js"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
|
@ -11,11 +11,14 @@ const AdmZip = require("adm-zip");
|
||||||
const Pharaoh = require("../egypt/pharaoh");
|
const Pharaoh = require("../egypt/pharaoh");
|
||||||
const desertConfig = require("../egypt/desert_config.json");
|
const desertConfig = require("../egypt/desert_config.json");
|
||||||
const config = require("../config.json");
|
const config = require("../config.json");
|
||||||
|
// Create the desert if it doesn't exist
|
||||||
|
if (!fexists(desertConfig.desertPath)) mkdir(desertConfig.desertPath);
|
||||||
//Constants
|
//Constants
|
||||||
const fileStorage = new Pharaoh(
|
const fileStorage = new Pharaoh(
|
||||||
resolvePath(desertConfig.desertPath),
|
resolvePath(desertConfig.desertPath),
|
||||||
desertConfig.schema
|
desertConfig.schema
|
||||||
);
|
);
|
||||||
|
|
||||||
const zipDir = resolvePath(config.Storage.ZipPath);
|
const zipDir = resolvePath(config.Storage.ZipPath);
|
||||||
function addFile(fileData) {
|
function addFile(fileData) {
|
||||||
fileStorage.addEntry(fileData.fileUuid, "files", fileData);
|
fileStorage.addEntry(fileData.fileUuid, "files", fileData);
|
||||||
|
|
|
@ -10,11 +10,11 @@
|
||||||
"ZipDownloadExpire": 720000
|
"ZipDownloadExpire": 720000
|
||||||
},
|
},
|
||||||
"Server": {
|
"Server": {
|
||||||
"Port": 4000,
|
"Port": 52001,
|
||||||
"Debug": false,
|
"Debug": false,
|
||||||
"BodyLimit": "5mb",
|
"BodyLimit": "5mb",
|
||||||
"ZipRemovalInterval": 1800000,
|
"ZipRemovalInterval": 1800000,
|
||||||
"jwtHeader": "authorization",
|
"jwtHeader": "authorization",
|
||||||
"authServer": "http://localhost:4001/api/user/data"
|
"authServer": "http://cairo.dunestorm.net:52000/api/user/data"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"desertPath": "desert/",
|
"desertPath": "src/desert/",
|
||||||
"schema": {
|
"schema": {
|
||||||
"files": {
|
"files": {
|
||||||
"tokenList": "abcdefghijklmnopqrstuvwxyz0123456789",
|
"tokenList": "abcdefghijklmnopqrstuvwxyz0123456789",
|
||||||
|
|
Reference in a new issue