add Dockerfile to discord-bot

This commit is contained in:
Synthintel0
2023-06-12 18:12:54 +08:00
parent 126327a152
commit 4854dabeea
2 changed files with 16 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
FROM node:19-alpine
COPY . /app
WORKDIR /app
RUN npm install
CMD ["sh", "-c", "npm run start:bot"]
+11
View File
@@ -38,3 +38,14 @@ Using Jarvis Discord Bot you can interact with Jarvis through Discord app on var
- Copy and paste the previously obtained `Token` and `CLIENT ID` into the `.env.local` file. - Copy and paste the previously obtained `Token` and `CLIENT ID` into the `.env.local` file.
- run `npm install`. - run `npm install`.
- run `npm run start:bot`. - run `npm run start:bot`.
### Running the bot in docker
```
# build docker image
docker build -t jarvis-discord-bot .
docker run -d --name jarvis-discord-bot \
-e CLIENT_ID='Your Client ID' \
-e BOT_TOKEN='Your Bot Token' \
-e WEBSOCKET_PORT=10000 \
jarvis-discord-bot:latest
```