diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..ca83ee8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +node_modules +.env +.git diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1d8ad2d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM node:20-alpine +WORKDIR /app +COPY package*.json ./ +RUN npm ci --omit=dev +COPY . . +CMD ["node", "medbot.js"] diff --git a/README.md b/README.md index d0614b2..eade66a 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,20 @@ npm i - Update config.json file if needed +## Docker + +To run the bot inside a Docker container: + +1. Create your `.env` file from `.env.inc` and fill in the variables. +2. Build the image: + ```bash + docker build -t medbot . + ``` +3. Start the container: + ```bash + docker run --env-file .env medbot + ``` + ## Usage To get started, please invite medbot to your server by clicking [here](https://goodloss.fr/medbot/invite). \ diff --git a/package.json b/package.json index e56b2d8..60524f7 100755 --- a/package.json +++ b/package.json @@ -2,8 +2,9 @@ "name": "medbot", "version": "1.1.5", "description": "", - "main": "index.js", + "main": "medbot.js", "scripts": { + "start": "node medbot.js", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [],