File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /.gitignore
2+ /.dockerignore
3+ /Dockerfile
4+ /RDMMonitorConfig.example.json
5+ /README.md
6+ /ecosystem.config.js
7+
8+ .git /
9+ static /
Original file line number Diff line number Diff line change 1+ # ## Build layer: Node.js 18 ###
2+ FROM node:18-alpine AS build-layer
3+ WORKDIR /app
4+
5+ # Install Vercel's pkg build tool
6+ RUN npm install -g pkg
7+
8+ # Install dependencies
9+ COPY package.json package-lock.json ./
10+ RUN npm install
11+
12+ # Build the self-contained application
13+ COPY RDMMonitor.js ./
14+ RUN pkg -t node18-alpine RDMMonitor.js
15+
16+ # ## Container ###
17+ FROM alpine
18+ WORKDIR /app
19+ ENV NODE_ENV=production
20+
21+ COPY --from=build-layer /app/RDMMonitor /app/RDMMonitor
22+ ENTRYPOINT ["/app/RDMMonitor" ]
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const path = require('path');
1010const args = process . argv . splice ( 2 ) ;
1111const configPath = args . length > 0
1212 ? path . resolve ( __dirname , args [ 0 ] )
13- : './ RDMMonitorConfig.json';
13+ : path . join ( process . cwd ( ) , ' RDMMonitorConfig.json') ;
1414const config = require ( configPath ) ;
1515const warningImage = "https://raw.githubusercontent.com/Kneckter/RDMMonitor/master/static/warned.png" ;
1616const okImage = "https://raw.githubusercontent.com/Kneckter/RDMMonitor/master/static/ok.png" ;
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ RDMDeviceMonitor is a simple discord bot to monitor device status for RDM.
1818
19195 . Copy the example file ` cp RDMMonitorConfig.example.json RDMMonitorConfig.json ` .
2020
21- 6 . Create an applicaiton and get the your bot's secret token, and application ID at:
21+ 6 . Create an application and get the your bot's secret token, and application ID at:
2222 * https://discordapp.com/developers/applications/me
2323
24247 . Get your application/bot to join your server by going here:
@@ -31,6 +31,18 @@ RDMDeviceMonitor is a simple discord bot to monitor device status for RDM.
3131
3232<hr />
3333
34+ # SETTING UP THE BOT USING DOCKER:
35+
36+ 1 . Run ` git clone https://github.com/Kneckter/RDMMonitor ` to copy the bot.
37+
38+ 2 . Change into the new folder ` cd RDMMonitor/ ` .
39+
40+ 3 . Build the container ` docker build -t rdm-monitor . `
41+
42+ 4 . Create the application and the configuration file according to step 6-8 from the previous section.
43+
44+ 5 . Start the Docker container: ` docker run -v ./RDMMonitorConfig.json:/app/RDMMonitorConfig.json rdm-monitor `
45+
3446# SETTINGS
3547```
3648token: Mandator, discord bot token, bot should have send message and manage message permissions in the designated channel
You can’t perform that action at this time.
0 commit comments