update compose file to use built images, update docker documentation, lint readme
All checks were successful
Build and Push Docker Image / build_and_push (push) Successful in 3s
All checks were successful
Build and Push Docker Image / build_and_push (push) Successful in 3s
This commit is contained in:
parent
3d12f1da4b
commit
347a2c836e
58
README.md
58
README.md
@ -1,47 +1,74 @@
|
|||||||
# request-bot
|
# request-bot
|
||||||
|
|
||||||
A Telegram bot which takes requests for modules.lol
|
A Telegram bot which takes requests for modules.lol
|
||||||
|
|
||||||
# Setting up and self hosting
|
## Setting up and self hosting
|
||||||
## With Docker
|
|
||||||
1. **Install dependancies**
|
### Using Docker
|
||||||
|
|
||||||
|
1. **Fetch needed files**
|
||||||
|
|
||||||
|
Pick your preferred option to get the files needed for Docker. Either option is fine, although Git is arguably the best option.
|
||||||
|
|
||||||
|
**Option One:** Clone Git Repo
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bun install
|
git clone https://git.pontusmail.org/aidan/request-bot.git
|
||||||
```
|
```
|
||||||
**OR**
|
|
||||||
|
**Option Two:** Download only needed files
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install
|
wget https://git.pontusmail.org/aidan/request-bot/raw/branch/main/docker-compose.yml
|
||||||
|
wget https://git.pontusmail.org/aidan/request-bot/src/branch/main/.env.example
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You may have to install `wget`, or you could use `curl` instead.
|
||||||
|
|
||||||
2. **Change variables**
|
2. **Change variables**
|
||||||
|
|
||||||
Copy `.env.example` to `.env` and open the file in a text editor.
|
Copy `.env.example` to `.env` and open the file in a text editor:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp .env.example .env # Copy .env file
|
||||||
|
nano .env # Open in nano (or vim, if you prefer)
|
||||||
|
```
|
||||||
|
|
||||||
Replace `ADMIN_ID` with your Telegram user ID. This will be used for admin-only commands.
|
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
|
Replace `BOT_TOKEN` with your Telegram bot token you created through @BotFather
|
||||||
|
|
||||||
3. **Build Image and Start**
|
3. **Bring up the containers**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker compose up -d --build
|
docker compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
Please note: `sudo` may be required.
|
Please note: `sudo` may be required.
|
||||||
|
|
||||||
You may customize the container with the included `docker-compose.yml` file.
|
You may customize the container with the included `docker-compose.yml` file if needed.
|
||||||
## The "Normal" way
|
|
||||||
1. **Install dependancies**
|
### Using Node
|
||||||
|
|
||||||
|
1. **Clone repository**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://git.pontusmail.org/aidan/request-bot.git
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Install dependencies**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bun install
|
bun install
|
||||||
```
|
```
|
||||||
|
|
||||||
**OR**
|
**OR**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install
|
npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Change variables**
|
3. **Change variables**
|
||||||
|
|
||||||
Copy `.env.example` to `.env` and open the file in a text editor.
|
Copy `.env.example` to `.env` and open the file in a text editor.
|
||||||
|
|
||||||
@ -49,13 +76,14 @@ A Telegram bot which takes requests for modules.lol
|
|||||||
|
|
||||||
Replace `BOT_TOKEN` with your Telegram bot token you created through @BotFather
|
Replace `BOT_TOKEN` with your Telegram bot token you created through @BotFather
|
||||||
|
|
||||||
3. **Start the bot**
|
4. **Start the bot**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bun index.js
|
bun index.js
|
||||||
```
|
```
|
||||||
|
|
||||||
**OR**
|
**OR**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
node index.js
|
node index.js
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
services:
|
services:
|
||||||
request-bot:
|
request-bot:
|
||||||
build: .
|
image: "git.pontusmail.org/aidan/request-bot:latest"
|
||||||
ports:
|
|
||||||
- "3000:3000"
|
|
||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .env:/app/.env
|
||||||
command: ["bun", "run", "index.js"]
|
|
Loading…
x
Reference in New Issue
Block a user