mirror of
https://github.com/informaticker/discord-jellyfin-bot.git
synced 2024-10-18 19:35:04 +02:00
added docker functionality
This commit is contained in:
parent
3ddfd6a349
commit
617b35d9af
3
.dockerignore
Normal file
3
.dockerignore
Normal file
@ -0,0 +1,3 @@
|
||||
node_modules
|
||||
package-lock.json
|
||||
config.json
|
8
DOCKERFILE
Normal file
8
DOCKERFILE
Normal file
@ -0,0 +1,8 @@
|
||||
FROM node:12
|
||||
|
||||
COPY package.json /app
|
||||
RUN npm install
|
||||
COPY . /app
|
||||
RUN npm run postinstall
|
||||
|
||||
CMD npm run start
|
21
parseENV.js
Normal file
21
parseENV.js
Normal file
@ -0,0 +1,21 @@
|
||||
const fs = require('fs');
|
||||
const filename='./config.json';
|
||||
const configfile = require(filename);
|
||||
|
||||
if(!configfile["discord-prefix"])
|
||||
configfile["discord-prefix"]=process.env.DISCORD_PREFIX;
|
||||
if(!configfile["token"])
|
||||
onfigfile["token"]=process.env.DISCORD_TOKEN;
|
||||
if(!configfile["server-adress"])
|
||||
configfile["server-adress"]=process.env.JELLYFIN_SERVER_ADDRESS;
|
||||
if(!configfile["jellyfin-username"])
|
||||
configfile["jellyfin-username"]=process.env.JELLYFIN_USERNAME;
|
||||
if(!configfile["jellyfin-password"])
|
||||
configfile["jellyfin-password"]=process.env.JELLYFIN_PASSWORD;
|
||||
if(!configfile["jellyfin-app-name"])
|
||||
configfile["jellyfin-app-name"]=process.env.JELLYFIN_APP_NAME;
|
||||
|
||||
|
||||
fs.writeFile(filename, JSON.stringify(configfile,null,1), (err) => {
|
||||
if (err) return console.log(err);
|
||||
});
|
Loading…
Reference in New Issue
Block a user