diff --git a/Dockerfile b/Dockerfile index c869a1b..7ac0e18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,4 +18,6 @@ RUN cd /home/node/app/node_api/api && npm install -D --force RUN cd /home/node/app/node_api/web && npm install -D --force RUN cd /home/node/app/node_api/web && npm run build -CMD ["NODE_ENV=production", "node", "/home/node/app/node_api/api/index.js"] +# set to production +ENV NODE_ENV=production +CMD ["node", "/home/node/app/node_api/api/index.js"] diff --git a/node_api/api/index.js b/node_api/api/index.js index 10f29c3..c865ac6 100644 --- a/node_api/api/index.js +++ b/node_api/api/index.js @@ -81,7 +81,7 @@ async function fetchTTSAudioURL(req, phrase, phraseId) { await synthesizePollyVoice(phrase, phraseId) } - return `${NODE_ENV === "production" ? "https" : req.protocol}://${req.get("host")}${req.path}/audio/${phraseId}.mp3` + return `${process.env.NODE_ENV === "production" ? "https" : req.protocol}://${req.get("host")}${req.path}/audio/${phraseId}.mp3` } async function handleApiRequest(req, res) {