File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ discord.js library to interact with Discord and fetches server stats via the XML
69
69
70
70
## Running the Bot
71
71
72
- ### Option 1: Run Inside a Docker Container
72
+ ### Option 1: Run Inside a Docker Container (Recommended)
73
73
74
74
1 . Navigate to the root directory of the cloned repository.
75
75
2 . Build and start the container:
Original file line number Diff line number Diff line change @@ -8,4 +8,20 @@ services:
8
8
container_name : ls25bot
9
9
restart : always
10
10
volumes :
11
- - ./config.json:/app/config.json
11
+ - ./config.json:/app/config.json
12
+
13
+ restart :
14
+ image : docker:cli
15
+ restart : unless-stopped
16
+ container_name : ls25bot-restart
17
+ volumes :
18
+ - /var/run/docker.sock:/var/run/docker.sock
19
+ entrypoint : [ "/bin/sh","-c" ]
20
+ command :
21
+ - |
22
+ echo "Restarting ls25bot container is running"
23
+ while true; do
24
+ sleep 7200 # Each 2 hours
25
+ echo "Restarting ls25bot container at $(date)"
26
+ docker restart ls25bot
27
+ done
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ discordClient.login(appConfig.discord.botToken).then(() => {
38
38
/**
39
39
* Start the DiscordService and restart it if an error occurred
40
40
*/
41
- function startDiscordService ( ) : void {
41
+ async function startDiscordService ( ) : Promise < void > {
42
42
try {
43
43
new DiscordService ( discordClient ) ;
44
44
} catch ( exception ) {
You can’t perform that action at this time.
0 commit comments