Files
svelte-mud/DOCKER-README.md
2025-04-21 23:22:32 +02:00

1.5 KiB

Svelte MUD Docker Setup

This guide explains how to use Docker to build and run the Svelte MUD client.

Solution Overview

This setup runs both the SvelteKit application and the WebSocket server in a single container, avoiding CORS issues. It follows the same approach used in development, where both servers run as separate processes but within the same context.

Prerequisites

Quick Start

  1. Navigate to the project directory:

    cd path/to/svelte-mud
    
  2. Build and start the container:

    docker-compose up -d
    
  3. Access the application:

Docker Commands

Starting the Application

# Build and start in detached mode
docker-compose up -d

# Build and start with logs
docker-compose up

# Force rebuild
docker-compose up --build

Stopping the Application

# Stop containers
docker-compose down

Viewing Logs

# View logs
docker-compose logs -f

Caddy Configuration

For use with Caddy as a reverse proxy, use this simple configuration:

mud.example.com {
    reverse_proxy svelte-mud:3000
}

Both the web interface and WebSocket connections will be routed correctly through this single reverse proxy rule.

Troubleshooting

If you encounter any issues, check the container logs:

docker-compose logs -f