Docker Deployment
Docker Deployment
Section titled “Docker Deployment”Docker is the recommended way to deploy TalesMUD in production. The included Dockerfile and
docker-compose.yml get you from source to running server with one command.
docker-compose.yml
Section titled “docker-compose.yml”The included compose file covers a basic deployment:
version: '3'services: talesmud: build: . ports: - "8010:8010" environment: - GIN_MODE=release - SQLITE_PATH=/data/talesmud.db - AUTH_ENABLED=false - ADMIN_USER=admin - ADMIN_PASSWORD=changeme volumes: - ~/volumes/talesmud/data:/dataQuick Start
Section titled “Quick Start”-
Clone and configure
Terminal window git clone https://github.com/TalesMUD/talesmud.gitcd talesmudcp .env.example .env# Edit .env with production values -
Start the container
Terminal window docker compose up -d -
View logs
Terminal window docker compose logs -f talesmud -
Stop
Terminal window docker compose down
Building the Image
Section titled “Building the Image”# Build locallydocker build -t talesmud .
# Run directlydocker run -d \ -p 8010:8010 \ -v ~/volumes/talesmud:/data \ -e GIN_MODE=release \ -e SQLITE_PATH=/data/talesmud.db \ -e ADMIN_USER=admin \ -e ADMIN_PASSWORD=changeme \ talesmudData Persistence
Section titled “Data Persistence”The SQLite database must be persisted outside the container. Mount a volume:
volumes: - ~/volumes/talesmud/data:/dataAnd set SQLITE_PATH=/data/talesmud.db.
Production Environment
Section titled “Production Environment”For production deployments:
environment: - GIN_MODE=release # Disables debug logging - LOG_LEVEL=info # Only info+ logs - SQLITE_PATH=/data/talesmud.db - AUTH_ENABLED=true # Enable Auth0 authentication - AUTH0_AUDIENCE=https://yourdomain.com/api - AUTH0_DOMAIN=https://your-tenant.auth0.com/ - AUTH0_WK_JWKS=https://your-tenant.auth0.com/.well-known/jwks.jsonHealth Check
Section titled “Health Check”Add a health check to your compose file:
services: talesmud: # ... healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8010/health"] interval: 30s timeout: 10s retries: 3 start_period: 40sWith Nginx (Reverse Proxy)
Section titled “With Nginx (Reverse Proxy)”For SSL termination and WebSocket proxying, add Nginx to your compose:
services: talesmud: build: . # Don't expose port directly — Nginx handles it environment: - GIN_MODE=release - SQLITE_PATH=/data/talesmud.db volumes: - ~/volumes/talesmud:/data
nginx: image: nginx:alpine ports: - "80:80" - "443:443" volumes: - ./nginx/default.conf:/etc/nginx/conf.d/default.conf - /etc/letsencrypt:/etc/letsencrypt:ro depends_on: - talesmudSee the Nginx Configuration guide for the full config.
Backup
Section titled “Backup”# Backup the databasedocker exec talesmud_talesmud_1 sqlite3 /data/talesmud.db \ ".backup /data/talesmud.backup.db"
# Copy backup to hostdocker cp talesmud_talesmud_1:/data/talesmud.backup.db ./backups/Next Steps
Section titled “Next Steps”- Environment Variables — Full config reference
- Nginx Configuration — SSL and WebSocket reverse proxy
- Auth0 Setup — Production authentication
- Production Checklist — Pre-launch checklist