You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You add the [projectConfig.databaseDriverOptions](../../configurations/medusa-config/page.mdx#databasedriveroptions) to disable SSL for the PostgreSQL database connection.
357
361
362
+
### Add Vite Configuration for Medusa Admin
363
+
364
+
To ensure that the Medusa Admin dashboard works correctly when running inside Docker, connects to the Medusa server, and reloads properly with Hot Module Replacement (HMR), add the following Vite configuration in `medusa-config.ts`:
365
+
366
+
```ts title="medusa-config.ts"
367
+
module.exports = defineConfig({
368
+
// ...
369
+
admin: {
370
+
vite: (config) => {
371
+
return {
372
+
...config,
373
+
server: {
374
+
...config.server,
375
+
host: "0.0.0.0",
376
+
// Allow all hosts when running in Docker (development mode)
377
+
// In production, this should be more restrictive
378
+
allowedHosts: [
379
+
"localhost",
380
+
".localhost",
381
+
"127.0.0.1",
382
+
],
383
+
hmr: {
384
+
...config.server?.hmr,
385
+
// HMR websocket port inside container
386
+
port: 5173,
387
+
// Port browser connects to (exposed in docker-compose.yml)
388
+
clientPort: 5173,
389
+
},
390
+
},
391
+
}
392
+
},
393
+
},
394
+
})
395
+
```
396
+
397
+
You configure the Vite development server to listen on all network interfaces (`0.0.0.0`) and set up HMR to work correctly within the Docker environment.
0 commit comments