Skip to content
Documentation
Documentation

Vite SPA + Docker

If your app is a pure Vite SPA with no backend, mus-server is the easiest path. Pull the Docker image, set your adapter env vars, and proxy /api/mus/ to it. No Node.js server to write or maintain.


Add a Vite proxy so browser requests reach the local mus-server:

vite.config.ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
server: {
proxy: {
'/api/mus/': {
target: 'http://localhost:3001',
changeOrigin: true,
},
},
},
})

Start mus-server locally with whichever adapter you’re using:

Terminal window
# Slack
docker run -d -p 3001:3001 \
-e SLACK_BOT_TOKEN=xoxb-your-token \
ghcr.io/datachefhq/mus-server:latest
# Discord
docker run -d -p 3001:3001 \
-e DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/... \
ghcr.io/datachefhq/mus-server:latest
# Multiple at once
docker run -d -p 3001:3001 \
-e SLACK_BOT_TOKEN=xoxb-your-token \
-e DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/... \
ghcr.io/datachefhq/mus-server:latest

The server logs which adapters it detected at startup, and exits immediately with a clear error if none are configured.


Terminal window
curl http://localhost:3001/healthz
# → ok

See Docker Compose for running mus-server as a service alongside your app, and nginx for proxying /api/mus/ to it in production.