1.5 KiB
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
- Docker
- Docker Compose (usually included with Docker Desktop)
Quick Start
-
Navigate to the project directory:
cd path/to/svelte-mud -
Build and start the container:
docker-compose up -d -
Access the application:
- Web interface: http://localhost:3000
- WebSocket server: ws://localhost:3001/mud-ws
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