Sign inSign up

knight1988/duel-bot

By knight1988

•Updated about 1 month ago

Basedbot duel revive

Image
0

3.5K

knight1988/duel-bot repository overview

⁠Docker image: knight1988/duel-bot

This project publishes a Docker image you can pull and run: knight1988/duel-bot.

The image requires two environment variables to run:

  • DiscordToken — your bot token from the Discord Developer Portal.
  • DatabaseConnectionString — a Postgres connection string (see example below).

Connection string format (Npgsql / .NET):

Host=HOST;Port=5432;Database=DB_NAME;Username=DB_USER;Password=DB_PASS

⁠Quick start (Docker CLI)

Pull the image:

docker pull knight1988/duel-bot:latest

Run the bot (replace the values with your own):

docker run -d \
	--name duel-bot \
	-e DiscordToken="YOUR_DISCORD_TOKEN" \
	-e DatabaseConnectionString="Host=host;Port=5432;Database=duel_db;Username=duel_user;Password=secret" \
	--restart unless-stopped \
	knight1988/duel-bot:latest

If your Postgres database runs on the same host and is listening on the default port, use Host=host.docker.internal on Docker Desktop for Windows to reach the host network from the container.

⁠Example: run Postgres locally (for development)

Start a lightweight Postgres container for local testing:

docker run -d \
	--name duel-db \
	-e POSTGRES_DB=duel_db \
	-e POSTGRES_USER=duel_user \
	-e POSTGRES_PASSWORD=secret \
	-p 5432:5432 \
	postgres:15-alpine

Then point the bot to it with:

Host=localhost;Port=5432;Database=duel_db;Username=duel_user;Password=secret

Create a docker-compose.yml with both Postgres and the bot. This example uses a simple healthcheck and depends_on to wait for Postgres.

version: '3.8'
services:
	db:
		image: postgres:15-alpine
		environment:
			POSTGRES_DB: duel_db
			POSTGRES_USER: duel_user
			POSTGRES_PASSWORD: secret
		ports:
			- "5432:5432"
		healthcheck:
			test: ["CMD-SHELL", "pg_isready -U duel_user"]
			interval: 5s
			retries: 5

	duel-bot:
		image: knight1988/duel-bot:latest
		environment:
			- DiscordToken=${DISCORD_TOKEN}
			- DatabaseConnectionString=Host=db;Port=5432;Database=duel_db;Username=duel_user;Password=secret
		depends_on:
			db:
				condition: service_healthy
		restart: unless-stopped

# Run with: DISCORD_TOKEN=yourtoken docker-compose up -d

Notes and tips

  • The image requires a working Postgres database reachable by the provided connection string. The repository includes EF Core migrations — ensure the database schema is applied before first run, either by applying migrations locally or by using a container entrypoint that runs migrations.
  • Keep your DiscordToken secret. Avoid hard-coding it into checked-in files.
  • For production, use a managed Postgres service or a secured database container and set appropriate resource limits, backups, and network rules.

Tag summary

Content type

Image

Digest

sha256:a196c7d31…

Size

94.7 MB

Last updated

about 1 month ago

docker pull knight1988/duel-bot