Docker

From a Docker perspective, a vite-plugin-ssr app is just a Node.js server, so we can use any Node.js server Docker configuration.

If we want to use Docker for development as well, we need to properly configure Docker for the Vite's HMR port.

If we use Windows with WSL, we need to to configure chockidar to use polling. (Vite uses chockidar.)

// package.json
{
  "scripts": {
    "dev": "CHOKIDAR_USEPOLLING=true npm run server"
  }
}

Note that it has been reported that vite.config.js#server.watch.usePolling doesn't work.

See also: