Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add http server port configuration for frontend and dashboard #168

Merged
merged 2 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]