Skip to content

Operations

Guides for deploying, configuring, and maintaining Genji Shimada in production and development environments.

Overview

This section covers:

  • Infrastructure - PostgreSQL, RabbitMQ, and cloud services
  • Docker Compose - Local and production deployments
  • Backups - Nightly prod backups and weekly dev refresh
  • Configuration - Environment variables and config files
  • Reverse Proxy - Caddy routing, domains, and TLS
  • Identity & Auth - Keycloak and oauth2-proxy
  • Cloudflare - DNS and CDN configuration
  • Monitoring - Grafana Alloy stack and dashboards

Environment Configuration

Create a .env file in the repo root with the variables required by your services. At minimum:

APP_ENVIRONMENT=development
DISCORD_TOKEN=your_bot_token
POSTGRES_USER=genjishimada
POSTGRES_PASSWORD=secure_password
POSTGRES_DB=genjishimada
RABBITMQ_USER=admin
RABBITMQ_PASS=secure_password
RABBITMQ_HOST=localhost
API_KEY=secure_api_key_for_bot

Add optional values for Sentry, R2, and Resend as needed.

If you run the API/bot in Docker, set RABBITMQ_HOST to the service name (genjishimada-rabbitmq-dev or genjishimada-rabbitmq).

Health Checks

API Health Check

Local development:

curl http://localhost:8000/healthcheck

Remote deployments: Access through your reverse proxy or internal Docker network.

Database Health

Local development:

docker exec genjishimada-db-local pg_isready -U genji

Remote staging:

docker compose -f docker-compose.dev.yml exec genjishimada-db-dev pg_isready

Remote production:

docker compose -f docker-compose.prod.yml exec genjishimada-db pg_isready

RabbitMQ Health

Local development: Access management UI at http://localhost:15672

Remote deployments: Use container logs or your reverse proxy setup.

Next Steps