From 4854dabeeaaae031017c20785b30c97879d8cae7 Mon Sep 17 00:00:00 2001 From: Synthintel0 Date: Mon, 12 Jun 2023 18:12:54 +0800 Subject: [PATCH] add Dockerfile to discord-bot --- discord_bot/Dockerfile | 5 +++++ discord_bot/README.md | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 discord_bot/Dockerfile diff --git a/discord_bot/Dockerfile b/discord_bot/Dockerfile new file mode 100644 index 0000000..129c917 --- /dev/null +++ b/discord_bot/Dockerfile @@ -0,0 +1,5 @@ +FROM node:19-alpine +COPY . /app +WORKDIR /app +RUN npm install +CMD ["sh", "-c", "npm run start:bot"] \ No newline at end of file diff --git a/discord_bot/README.md b/discord_bot/README.md index 99a6bb1..1bd3d9f 100644 --- a/discord_bot/README.md +++ b/discord_bot/README.md @@ -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. - run `npm install`. - 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 +``` \ No newline at end of file