Unified server for docker

This commit is contained in:
2025-04-21 22:18:23 +02:00
parent 32dd6ff811
commit 2bfd1b100e
5 changed files with 233 additions and 14 deletions

View File

@@ -21,7 +21,7 @@ This guide explains how to use Docker to build and run the Svelte MUD client.
3. Access the application:
- Web interface: http://localhost:3000
- WebSocket server: ws://localhost:3001/mud-ws
- WebSocket server: ws://localhost:3000/mud-ws (both services now run on the same port)
## Docker Commands
@@ -63,9 +63,8 @@ docker-compose logs -f svelte-mud
## Configuration
The Docker setup uses the following ports:
- Port 3000: Web server
- Port 3001: WebSocket server
The Docker setup uses a single port for both the web interface and WebSocket server:
- Port 3000: Unified server (Web + WebSocket)
You can modify these ports in the `docker-compose.yml` file if needed.
@@ -80,7 +79,7 @@ services:
svelte-mud:
environment:
- NODE_ENV=production
- WS_PORT=3001
- PORT=3000
# Add your custom environment variables here
```
@@ -93,8 +92,8 @@ The default configuration is optimized for production use. It:
## Troubleshooting
1. **Port conflicts**: If ports 3000 or 3001 are already in use, modify the port mappings in `docker-compose.yml`.
1. **Port conflicts**: If port 3000 is already in use, modify the port mapping in `docker-compose.yml`.
2. **Build failures**: Ensure that all dependencies are properly defined in your package.json.
3. **Connection issues**: If you can't connect to the WebSocket server, verify that your client is using the correct URL format: `ws://localhost:3001/mud-ws?host=YOUR_MUD_HOST&port=YOUR_MUD_PORT`.
3. **Connection issues**: If you can't connect to the WebSocket server, verify that your client is using the correct URL format: `ws://localhost:3000/mud-ws?host=YOUR_MUD_HOST&port=YOUR_MUD_PORT`.