Skip to content
Documentation
Documentation

Vite SPA + Docker

If your app has no backend (pure Vite SPA), run mus-server as a pre-built Docker container. The image handles everything with no Node.js server to write.

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'
import { musVitePlugins } from '@datachef/mus/vite'
export default defineConfig({
plugins: [react(), ...musVitePlugins()],
server: {
proxy: {
'/api/mus/': {
target: 'http://localhost:3001',
changeOrigin: true,
},
},
},
})
.env
SLACK_BOT_TOKEN=xoxb-your-bot-token

The musVitePlugins() helper starts a local development server that reads SLACK_BOT_TOKEN from the environment. You can also skip the plugin and just run mus-server manually with Docker.

Run mus-server locally:

Terminal window
docker run -d \
-p 3001:3001 \
-e SLACK_BOT_TOKEN=xoxb-your-token \
ghcr.io/datachefhq/mus-server:latest

See Docker Compose for adding mus-server as a service, and nginx for proxying /api/mus/ to it.

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