docs: update deployment instructions with all three methods (.env file, docker run env vars, docker-compose)

This commit is contained in:
unfunny
2026-09-13 01:06:50 -04:00
parent aa6c321b73
commit f2016da05a
3 changed files with 77 additions and 33 deletions

View File

@@ -1,40 +1,69 @@
# Ancestor Quote Bot
# Ancestor Quote Bot 🎃
A Matrix chatbot that responds to `/quote` commands with random quotes from Darkest Dungeons' Narrator/Ancestor.
A Matrix chatbot that responds to `!quote` commands with random quotes from Darkest Dungeons.
## Setup
## Quick Start
1. Copy `.env.example` to `.env` and fill in your credentials:
```bash
cp .env.example .env
```
```bash
# 1. Update .env file (create from template)
cp .env.example .env
# Edit .env with your MATRIX_ACCESS_TOKEN and MATRIX_HOME_SERVER
2. Build the Docker image:
```bash
docker build -t ancestor-quote-bot .
```
# 2. Build Docker image
docker build -t ancestor-quote-bot .
3. Run the bot:
```bash
docker run --rm \
-e MATRIX_HOME_SERVER=https://your.matrix.server.com \
-e MATRIX_ACCESS_TOKEN=your_access_token_here \
ancestor-quote-bot
```
# 3. Run the bot
docker run --rm \
-e MATRIX_HOME_SERVER=https://matrix.org \
-e MATRIX_ACCESS_TOKEN=your_token_here \
ancestor-quote-bot
```
## Deployment Options
### Option 1: Pass env vars via `docker run` (Recommended for Docker)
```bash
docker run --rm \
-e MATRIX_HOME_SERVER=https://matrix.org \
-e MATRIX_ACCESS_TOKEN=your_access_token_here \
-e BOT_COMMAND=!quote \
ancestor-quote-bot
```
### Option 2: Mount .env file directly
```bash
docker run --rm \
-v $(pwd)/.env:/app/.env \
ancestor-quote-bot
```
### Option 3: Use docker-compose.yml (Production)
```bash
docker compose up -d
# Or with custom env:
docker compose up -d \
-e MATRIX_HOME_SERVER=https://matrix.org \
-e MATRIX_ACCESS_TOKEN=your_access_token_here
```
## Configuration
- `MATRIX_HOME_SERVER`: Your Matrix homeserver URL (e.g., https://matrix.org)
- `MATRIX_ACCESS_TOKEN`: Bot access token for authentication
- `BOT_COMMAND`: The command trigger (default: `!quote`)
| Variable | Description | Default |
|----------|-------------|---------|
| `MATRIX_HOME_SERVER` | Matrix homeserver URL (e.g., https://matrix.org) | https://matrix.org |
| `MATRIX_ACCESS_TOKEN` | Bot access token for authentication | REQUIRED |
| `BOT_COMMAND` | Command trigger to request a quote | !quote |
## Usage
## How It Works
Type the bot command in any room you've joined, and it will reply with a random Ancestor quote.
1. The bot connects to your Matrix homeserver using the provided access token
2. Once joined to a room, it listens for messages containing the trigger command
3. When triggered, it selects a random quote from `quotes.json` and replies instantly
Example:
```
Room: #general:matrix.org
!quote
Bot: Dispatch this thug in brutal fashion, that all may hear of your arrival!
```
## Getting an Access Token
Use [this](https://matrix.org/docs/projects/registration/matrix-registration-api) or your Matrix admin panel to register a bot account.
## License
ISC