LogoAntiRaid

Docker hosting guide

docs related to docker hosting

Docker Hosting for AntiRaid Infrastructure

This document details the Docker-based hosting setup for the AntiRaid project, covering all major services, networking, configuration, and operational tips. It is tailored to the actual infrastructure and files in this repository.


Note

While we support hosting from docker this is currently not recommended as we've seen decreased performance and other similar issues.

Overview

AntiRaid uses Docker Compose to orchestrate a multi-service infrastructure, including:

  • Discord gateway proxy (nirn-proxy)
  • Sandwich-Daemon (gateway manager)
  • Bot, API, Template Worker, Jobserver
  • Postgres and SeaweedFS (object storage)
  • Redis (cache)
  • Nginx (API/SeaweedFS exposer)
  • Filestash (SeaweedFS management)

All service definitions are in docker-compose.yml. For Postgres-only setups, use docker-compose-justpg.yml.


Service Breakdown

nirn-proxy

  • Purpose: Discord REST/gateway proxy
  • Build Context: infra/nirn-proxy/
  • Secrets: Uses infra/nirn-proxy/secrets.docker.json (auto-generated by data/docker/setup.py)
  • Ports: 3222 (host) → 3221 (container)

Sandwich-Daemon

  • Purpose: Discord gateway manager
  • Build Context: infra/Sandwich-Daemon/
  • Config: infra/Sandwich-Daemon/sandwich.docker.yaml (auto-generated)
  • Ports: 29334 (API), 3931 (Prometheus), 3600 (WebSocket)

Postgres

  • Purpose: Main database
  • Build Context: data/docker/postgres/
  • Volumes:
    • data/seed.iblcli-seed (seed data)
    • data/state/postgres (data dir)
    • data/state/postgres-other (other state)
  • Env: User: antiraid, Password: AnTiRaId123!

SeaweedFS & seaweed_postgres

  • Purpose: Object storage (S3-like)
  • Build Context: data/docker/seaweed/ and data/docker/seaweed-postgres/
  • Config: filer.toml, replication.toml, s3.json (auto-generated)
  • Ports: 9333 (master), 9334 (volume), 8333 (S3)

Filestash & filestash_wopi

  • Purpose: Web UI for SeaweedFS
  • Images: machines/filestash:latest, collabora/code
  • Ports: 8334 (Filestash), 9980 (WOPI)

Bot, Template Worker, Jobserver, API

  • Purpose: Core AntiRaid services
  • Build Contexts: services/bot/, services/template-worker/, services/jobserver/, services/api/
  • Config: config.docker.yaml (auto-generated)
  • Healthchecks: All have HTTP health endpoints

Redis

  • Purpose: Caching for API
  • Image: redis:7.2.7
  • Volume: data/state/redis

Nginx (api_exposer)

  • Purpose: Exposes API and SeaweedFS to host
  • Config: data/docker/nginx.conf
  • Ports: 5600 (API), 5601 (SeaweedFS)

Networks

  • antiraid_infra: External access (for infra)
  • antiraid_internal: Internal-only (no external net)
  • antiraid_api: API/Redis/Nginx
  • antiraid_seaweed: SeaweedFS/Filestash
  • antiraid_jobserver: Jobserver (external net)

Setup Instructions

  1. Clone the repo recursively:

    git clone https://github.com/Anti-Raid/antiraid --recursive
  2. Run the setup script:

    python3 data/docker/setup.py
    • Enter your bot token, client ID, client secret, and alert webhook when prompted.
    • This generates all required config files and secrets.
  3. Start all services:

    docker compose up --build
    • Use docker compose -f docker-compose-justpg.yml up for Postgres only.

Operational Tips

  • Logs:
    docker compose logs -f <service>
  • Rebuild after changes:
    docker compose build
  • Access a container shell:
    docker exec -it <container_name> /bin/sh
  • Check health: All services have healthchecks; use docker ps and docker inspect for status.
  • Volumes: Persistent data is stored in data/state/ and data/seed.iblcli-seed.
  • Environment: Most config is in config.docker.yaml (auto-generated).

Customization & Advanced

  • Nginx config: See data/docker/nginx.conf for API/SeaweedFS proxy rules.
  • SeaweedFS:
    • Configs: filer.toml, replication.toml, s3.json in data/docker/seaweed/
    • Entrypoint: entrypoint.sh ensures configs are copied on container start.
  • Database seeding: Uses iblcli (see README for manual steps if needed).
  • Systemd: Example service files in systemd-example/ for native hosting.

Troubleshooting

  • Ensure Docker and Docker Compose V2 are installed.
  • Check that all required config files are generated (run setup.py if missing).
  • Use docker compose logs for debugging service issues.
  • Make sure required ports are not in use.
  • For database issues, check persistent volumes in data/state/.

For more details, see the main README.md and service-specific documentation.

Last updated on