Browse Source

Expose ssl port

master
Garrit Franke 3 years ago
parent
commit
3682020adf
  1. 1
      client/Dockerfile
  2. 5
      client/app.js

1
client/Dockerfile

@ -9,4 +9,5 @@ RUN npm ci
COPY . .
EXPOSE 80
EXPOSE 443
CMD [ "npm", "start" ]

5
client/app.js

@ -51,12 +51,15 @@ app.get("/*", (req, res) => {
if (process.env.NODE_ENV === "production") {
console.log("Starting server in production mode");
const options = {
cert: fs.readFileSync("./certs/fullchain.pem"),
key: fs.readFileSync("./certs/privkey.pem"),
};
https.createServer(options, app).listen(443);
} else {
console.log("Starting server in debug mode");
app.listen(process.env.PORT || 80);
}
app.listen(process.env.PORT || 80);

Loading…
Cancel
Save