diff --git a/api-prox/Dockerfile b/api-prox/Dockerfile index 685c598..de0c3a1 100644 --- a/api-prox/Dockerfile +++ b/api-prox/Dockerfile @@ -13,6 +13,5 @@ COPY tsconfig.json ./ RUN mkdir -p /app/hooks EXPOSE 7001 -ENV PORT=7001 -ENV HOSTNAME="0.0.0.0" + CMD ["npm", "run", "serve"] \ No newline at end of file diff --git a/api-prox/index.ts b/api-prox/index.ts index 1cc7f7c..0fdec06 100644 --- a/api-prox/index.ts +++ b/api-prox/index.ts @@ -20,8 +20,8 @@ app.use( app.use(express.json()); app.use(express.urlencoded({ extended: true })); -const host = "0.0.0.0"; -const port = 7001; +const HOST = process.env.HOST || "0.0.0.0"; +const PORT = process.env.PORT ? parseInt(process.env.PORT, 10) : 7001; let hooks: string[] = []; @@ -356,7 +356,7 @@ app.post("/*path", async (req, res) => { return; }); -app.listen(port, host, function () { +app.listen(PORT, HOST, function () { loadHooks(); - logger.info(`Server listen: http://${host}:${port}`); + logger.info(`Server listen: http://${HOST}:${PORT}`); });