Skip to content
This repository was archived by the owner on Dec 22, 2023. It is now read-only.

Commit 654ec3b

Browse files
authored
run docker unprivileged + add documentation (#13)
1 parent 2620b11 commit 654ec3b

File tree

2 files changed

+34
-19
lines changed

2 files changed

+34
-19
lines changed

.deploy/Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ RUN mvn
99
RUN cp target/gameboi-*-jar-with-dependencies.jar gameboi.jar
1010

1111
FROM openjdk:11
12+
RUN addgroup bot && adduser bot --ingroup bot
13+
USER bot:bot
1214

1315
WORKDIR /usr/src/app
1416

1517
COPY --from=builder /usr/src/build/gameboi.jar .
1618
COPY --from=builder /usr/src/build /usr/src/build
17-
COPY .deploy/start.sh .deploy/start.sh
19+
COPY .deploy/start.sh start.sh
1820

1921
WORKDIR /var/gameboi
2022

21-
CMD ["/usr/src/app/.deploy/start.sh"]
23+
CMD ["/usr/src/app/start.sh"]

README.md

+30-17
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Click [here](https://discordapp.com/oauth2/authorize?scope=bot&client_id=5930905
2020

2121
You can also join the [official RayzrDev server](https://rayzr.dev/join) to play with Gameboi yourself :)
2222

23-
## Download
23+
## Run
2424

2525
You can download and run the bot yourself by grabbing the latest JAR from [the RayzrDev Jenkins server here](https://ci.rayzr.dev/job/Gameboi). Simply run the JAR from the commandline like so:
2626

@@ -30,24 +30,37 @@ java -jar gameboi-VERSION-jar-with-dependencies.jar
3030

3131
A `config.yml` file will be generated in the working directory the first time you run the bot, so just fill in your bot token and prefix and you're good to go!
3232

33+
Alternatively, you can run using the [rayzr522/gameboi](https://hub.docker.com/r/rayzr522/gameboi) Docker image:
34+
35+
```bash
36+
# create the data directory
37+
mkdir data
38+
39+
# run the container with the data directory mounted
40+
docker run --rm -it -v $(pwd)/data:/var/gameboi rayzr522/gameboi
41+
42+
# or if you want it to run in the background and not be removed after it exits
43+
docker run -v $(pwd)/data:/var/gameboi rayzr522/gameboi
44+
```
45+
3346
## Commands
3447

35-
Command | Description
36-
------- | -----------
37-
`help` | Shows you help for Gameboi
38-
`invite` | Gives you an invite link for Gameboi
39-
`about` | Shows you information about Gameboi
40-
`ping` | Shows you the bot's ping
41-
`stats [game]` | Shows your game stats
42-
`connect4 <other>` | Invites a player to play Connect4 with you!
43-
`fight <other>` | Invites a player to play Fight with you!
44-
`2048` | Starts a 2048 game.
45-
`hangman` | Starts a hangman game.
46-
`quit` | Quits you from your current match
47-
`shop` | Lets you see what is available for purchase in the shop
48-
`buy <item>` | Lets you buy items from the shop
49-
`inventory` | Shows you what items you currently have
50-
`equip <slot> <none OR item>` | Lets you equip different items
48+
| Command | Description |
49+
| ----------------------------- | ------------------------------------------------------- |
50+
| `help` | Shows you help for Gameboi |
51+
| `invite` | Gives you an invite link for Gameboi |
52+
| `about` | Shows you information about Gameboi |
53+
| `ping` | Shows you the bot's ping |
54+
| `stats [game]` | Shows your game stats |
55+
| `connect4 <other>` | Invites a player to play Connect4 with you! |
56+
| `fight <other>` | Invites a player to play Fight with you! |
57+
| `2048` | Starts a 2048 game. |
58+
| `hangman` | Starts a hangman game. |
59+
| `quit` | Quits you from your current match |
60+
| `shop` | Lets you see what is available for purchase in the shop |
61+
| `buy <item>` | Lets you buy items from the shop |
62+
| `inventory` | Shows you what items you currently have |
63+
| `equip <slot> <none OR item>` | Lets you equip different items |
5164

5265
## Screenshots
5366

0 commit comments

Comments
 (0)