vite-plugin-mkcert icon indicating copy to clipboard operation
vite-plugin-mkcert copied to clipboard

Running inside docker container

Open Shujee opened this issue 1 year ago • 1 comments

Is this plug-in supposed to work in a docker container too?

  1. How should my vite.config.ts look like?
  2. Also what port(s) should I map in my docker-compose file?
  3. Is server.hmr option required/preferred in this scenario?

I have been struggling with it for several hours. In the best case scenario I was getting NET::ERR_CERT_AUTHORITY_INVALID in the browser when trying to access vite dev server.

In the current setup, I am:

  1. Using -- host option with the dev script.
  2. Running vite server on port 3000.
  3. Mapping port 3000 to 3005 of the host machine in my docker-compose file

But I cannot access the Vite server in a host browser using any of 127.0.0.1, localhost and 0.0.0.0.

Shujee avatar Dec 13 '23 18:12 Shujee

I'm sorry, I'm not very familiar with Docker

liuweiGL avatar Dec 14 '23 02:12 liuweiGL