Operaciones

Operations Guide

This guide covers deployment, configuration, and maintenance.

Configuration Reference (.env)

AuditorIA requires several environment variables for different components.

Docker & Database

VariableDescriptionDefault
POSTGRES_DBDatabase Nameauditoria_db
POSTGRES_USERDatabase Userroot
POSTGRES_PASSWORDDatabase Passwordpassword
TZTimezoneAmerica/Argentina/Buenos_Aires
MINIO_ROOT_USERMinIO Admin Userminioadmin
MINIO_ROOT_PASSWORDMinIO Admin Passwordminioadmin
KEYCLOAK_ADMINKeycloak Admin Useradmin
KEYCLOAK_ADMIN_PASSWORDKeycloak Admin Passwordadmin

Backend

VariableDescriptionDefault/Example
DB_URLInternal DB Connection Stringpostgresql://root:password@whisperx_postgres:5432/auditoria_db
WHISPER_MODELAI Model Sizelarge-v3
DEFAULT_LANGDefault Transcription Langes
HF_TOKENHugging Face Token (Diarization)hf_...
OPENAI_API_KEYOpenAI Key (Generative AI)sk-...
KEYCLOAK_SERVER_URLInternal Keycloak URLhttp://keycloak:8080
KEYCLOAK_REALMKeycloak Realmauditoria
KEYCLOAK_CLIENT_IDKeycloak Client ResourceAuditoria
KEYCLOAK_CLIENT_SECRETClient Secretyour_secret
MINIO_URLInternal MinIO URLhttp://minio:9000

Frontend

VariableDescription
NEXT_PUBLIC_API_URLPublic API URL
NEXT_PUBLIC_KEYCLOAK_URLPublic Keycloak URL
NEXT_PUBLIC_KEYCLOAK_REALMPublic Realm Name
NEXT_PUBLIC_KEYCLOAK_CLIENT_IDClient ID
NEXT_PUBLIC_POSTHOG_KEYAnalytics Key (Optional)
GRAFANA_URLEmbed URL for Analytics

Deployment Strategies

Docker Swarm / Kubernetes

We recommend using the provided docker-compose.yml as a base for Kubernetes manifests. Ensure Persistence for:

  • /var/lib/postgresql/data (Postgres)
  • /data (MinIO)

Reverse Proxy (Nginx)

In production, place Nginx in front of the services to handle SSL termination and path routing.

Troubleshooting

MinIO Connection Refused

  • Symptom: Backend logs show ConnectionRefusedError when uploading.
  • Cause: The container cannot reach minio:9000.
  • Fix: Check that auditoria_backend and minio are on the same Docker network. Ensure MINIO_URL is set to http://minio:9000 (internal) and not localhost.

GPU Not Detected

  • Symptom: Worker relies on CPU, transcription is slow.
  • Fix: Ensure nvidia-container-toolkit is installed on the host and the worker service has deploy: resources: reservations: devices: - driver: nvidia configured.

Keycloak Loop / Duplicate Resource

  • Symptom: Keycloak fails to start with "Duplicate resource" error.
  • Cause: Conflict between realm-export.json and Keycloak's default initialization of service accounts.
  • Fix:
    1. Stop services: docker-compose down -v (Warning: Deletes data volume).
    2. Set serviceAccountsEnabled: false in realm-export.json.
    3. Restart: docker-compose up -d --build.

Database Connection Failed

  • Symptom: Backend loops waiting for database.
  • Cause: Postgres container is unhealthy or waiting for initialization.
  • Fix: Check docker logs whisperx_postgres. Ensure the healthcheck in docker-compose.yml is passing.

Frontend 500 Error on Login

  • Symptom: "Internal Server Error" after Keycloak redirect.
  • Cause: Mismatch in KEYCLOAK_CLIENT_SECRET between Frontend and Keycloak, or incorrect NEXT_PUBLIC_API_URL.
  • Fix: Verify secrets in .env match the Keycloak Client Credentials.