From 0c46ba4d8040aee16ea166610a8a5330fb520ae8 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 16 Jul 2023 21:31:36 +0200 Subject: [PATCH] Add option to configure the vite dev server host (#2005) If you want to run the vite dev server in a container, it needs to be exposed to `0.0.0.0`. --- web/vite.config.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/vite.config.ts b/web/vite.config.ts index dd788856f..34b5bdbc6 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -16,8 +16,9 @@ function woodpeckerInfoPlugin() { name: 'woodpecker-info', configureServer() { const info = - 'Please add `WOODPECKER_DEV_WWW_PROXY=http://localhost:8010` to your `.env` file.\n' + - 'After starting the woodpecker server as well you should now be able to access the UI at http://localhost:8000/'; + '1) Please add `WOODPECKER_DEV_WWW_PROXY=http://localhost:8010` to your `.env` file.\n' + + 'After starting the woodpecker server as well you should now be able to access the UI at http://localhost:8000/\n\n' + + '2) If you want to run the vite dev server (`pnpm start`) within a container please set `VITE_DEV_SERVER_HOST=0.0.0.0`.'; // eslint-disable-next-line no-console console.log(info); }, @@ -71,6 +72,7 @@ export default defineConfig({ }, logLevel: 'warn', server: { + host: process.env.VITE_DEV_SERVER_HOST || '127.0.0.1', port: 8010, }, });