Skip to content

Commit

Permalink
Merge pull request #168 from linto-ai/configure_server_port
Browse files Browse the repository at this point in the history
Add http server port configuration for frontend and dashboard
  • Loading branch information
Houpert authored Feb 4, 2025
2 parents 3940128 + 84fe7fe commit c2903c3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
3 changes: 1 addition & 2 deletions studio-dashboard/.dockerenv
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
DASHBOARD_HTTP_PORT=80
DASHBOARD_HTTP_HOST=localhost
WEBSERVER_HTTP_PORT=80

# Mongo
DB_HOST=studio-mongo
Expand Down
3 changes: 1 addition & 2 deletions studio-dashboard/.envdefault
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
DASHBOARD_HTTP_PORT=80
DASHBOARD_HTTP_HOST=127.0.0.1
WEBSERVER_HTTP_PORT=80

# Mongo
DB_HOST=localhost
Expand Down
2 changes: 1 addition & 1 deletion studio-dashboard/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ app.get("/users/:id", async function (req, res) {
}
})

app.listen(80) //as stated in dockerfile : EXPOSE 80
app.listen(process.env.WEBSERVER_HTTP_PORT)
console.log(
`Back Office Dashboard Started`
)
7 changes: 5 additions & 2 deletions studio-frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM node:20.15.1 as builder

ARG WEBSERVER_HTTP_PORT=80

RUN apt-get update -y && \
apt-get install gettext -y && \
apt-get install nginx -y
Expand All @@ -11,6 +13,7 @@ RUN npm install

RUN rm -rf /usr/share/nginx/html/*
COPY ./config/nginx/nginx.conf /etc/nginx/nginx.conf
RUN sed -i "s/listen [0-9]\+;/listen ${WEBSERVER_HTTP_PORT};/" /etc/nginx/nginx.conf

COPY ./docker-entrypoint.sh /

Expand All @@ -20,5 +23,5 @@ USER node

HEALTHCHECK CMD curl -f http://localhost

EXPOSE 80
ENTRYPOINT ["/docker-entrypoint.sh"]
EXPOSE ${WEBSERVER_HTTP_PORT}
ENTRYPOINT ["/docker-entrypoint.sh"]

0 comments on commit c2903c3

Please sign in to comment.