Docker
Documentation about using Vike with Docker.
💚This page is maintained by the community and may contain outdated information; PR welcome to update or improve it.
From the server's perspective, a Vike app is just a Node.js server, which means you can use any Node.js container image to run your Vike app.
If you use Docker also for development, and HMR doesn't work or you can't access your Vike app, then see Development.
If you build your app inside your Docker container and run into out-of-memory errors, then see Out-of-memory errors.
Development
You can use Docker also for development, see workarounds if you run into following issues:
HMR doesn't work
If you are using Docker and HMR doesn't work:
- If you are under Windows and using Docker with WSL, then have a look at Windows Subsystem for Linux (WSL) for how to enable HMR.
- You may need to configure Docker for Vite's HMR websocket connection.
Cannot access app
Vite's server.host
setting should be truthy so that your app can be accessed from outside your Docker container, such as from the browser.
Vike automatically changes the default value of
server.host
fromfalse
totrue
if it detects a Docker or Podman container environment.
Out-of-memory errors
If you build your app inside your Docker container, you may stumble upon out-of-memory errors.
Check whether your Docker container has enough memory, and you may also need to set Node.js' --max-old-space-size
.