diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c0ec316 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM oven/bun:latest +WORKDIR /app +COPY package.json bun.lockb ./ +RUN bun install +COPY . . +CMD ["bun", "run", "index.js"] \ No newline at end of file diff --git a/README.md b/README.md index 0ef467c..4a46b5a 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,33 @@ A Telegram bot which takes requests for modules.lol # Setting up and self hosting ## With Docker -I'll add these instructions later! +1. **Install dependancies** + + ```bash + bun install + ``` + **OR** + ```bash + npm install + ``` + +2. **Change variables** + + Copy `.env.example` to `.env` and open the file in a text editor. + + Replace `ADMIN_ID` with your Telegram user ID. This will be used for admin-only commands. + + Replace `BOT_TOKEN` with your Telegram bot token you created through @BotFather + +3. **Build Image and Start** + + ```bash + docker compose up -d --build + ``` + + Please note: `sudo` may be required. + + You may customize the container with the included `docker-compose.yml` file. ## The "Normal" way 1. **Install dependancies** @@ -32,3 +58,4 @@ I'll add these instructions later! ```bash node index.js ``` + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..90a8e18 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +services: + request-bot: + build: . + ports: + - "3000:3000" + volumes: + - .:/app + command: ["bun", "run", "index.js"] \ No newline at end of file