From d4ce7539e2f5acf6a920a5d4116937f79137d733 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Fri, 20 Dec 2024 18:33:31 +0100 Subject: [PATCH] serve compiled js files instead of compile on demand, because it no need more than 2 minutes --- frontend/Dockerfile | 2 +- frontend/run/server.js | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 6f6cc0e9e..365906941 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -76,7 +76,7 @@ FROM build as test RUN apk add --no-cache bash jq # Run command -CMD /bin/sh -c "yarn run dev" +CMD /bin/sh -c "yarn run start" ################################################################################## # PRODUCTION (Does contain only "binary"- and static-files to reduce image size) # diff --git a/frontend/run/server.js b/frontend/run/server.js index 4a49dcd75..a459230b3 100644 --- a/frontend/run/server.js +++ b/frontend/run/server.js @@ -1,10 +1,15 @@ // Imports +const dotenv = require('dotenv') const express = require('express') const path = require('path') +dotenv.config() // load env vars from .env + +const CONFIG = require('../src/config') + // Host & Port -const hostname = '127.0.0.1' -const port = process.env.PORT || 3000 +const hostname = CONFIG.FRONTEND_MODULE_HOST +const port = CONFIG.FRONTEND_MODULE_PORT // Express Server const app = express()