From cf54652e52ce89c10d0f93633a11e5f8dd4defc5 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Fri, 20 Dec 2024 17:25:08 +0100 Subject: [PATCH] fix problems with docker container, vite host must be 0.0.0.0 not localhost else, it don't workgit add admin frontend! --- admin/src/config/index.js | 2 +- frontend/run/server.js | 2 +- frontend/src/config/index.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/src/config/index.js b/admin/src/config/index.js index 32abee87a..2c6302e29 100644 --- a/admin/src/config/index.js +++ b/admin/src/config/index.js @@ -14,7 +14,7 @@ const constants = { const version = { ADMIN_MODULE_PROTOCOL: process.env.ADMIN_MODULE_PROTOCOL ?? 'http', - ADMIN_MODULE_HOST: process.env.ADMIN_MODULE_HOST ?? 'localhost', + ADMIN_MODULE_HOST: process.env.ADMIN_MODULE_HOST ?? '0.0.0.0', ADMIN_MODULE_PORT: process.env.ADMIN_MODULE_PORT ?? '8080', APP_VERSION: pkg.version, BUILD_COMMIT: process.env.BUILD_COMMIT ?? null, diff --git a/frontend/run/server.js b/frontend/run/server.js index 98d11ee7e..4a49dcd75 100644 --- a/frontend/run/server.js +++ b/frontend/run/server.js @@ -4,7 +4,7 @@ const path = require('path') // Host & Port const hostname = '127.0.0.1' -const port = import.meta.env.PORT || 3000 +const port = process.env.PORT || 3000 // Express Server const app = express() diff --git a/frontend/src/config/index.js b/frontend/src/config/index.js index 8f0275aa3..c20e8e8cf 100644 --- a/frontend/src/config/index.js +++ b/frontend/src/config/index.js @@ -15,7 +15,7 @@ const constants = { const version = { FRONTEND_MODULE_PROTOCOL: process.env.FRONTEND_MODULE_PROTOCOL ?? 'http', - FRONTEND_MODULE_HOST: process.env.FRONTEND_MODULE_HOST ?? 'localhost', + FRONTEND_MODULE_HOST: process.env.FRONTEND_MODULE_HOST ?? '0.0.0.0', FRONTEND_MODULE_PORT: process.env.FRONTEND_MODULE_PORT ?? '3000', APP_VERSION: pkg.version, BUILD_COMMIT: process.env.BUILD_COMMIT ?? null,