🔧 Change internal port to 8080, for non-sudo access

This commit is contained in:
Alicia Sykes 2022-02-20 22:46:41 +00:00
parent 6a0fef6356
commit 39dbb4c4fc
4 changed files with 118 additions and 118 deletions

View File

@ -28,7 +28,7 @@ RUN yarn build
FROM node:16.13.2-alpine
# Define some ENV Vars
ENV PORT=80 \
ENV PORT=8080 \
DIRECTORY=/app \
IS_DOCKER=true \
USER=docker \

View File

@ -24,9 +24,9 @@ services:
# - /path/to/my-config.yml:/app/public/conf.yml
# - /path/to/item-icons:/app/public/item-icons
# Set port that web service will be served on. Keep container port as 80
# Set port that web service will be served on. Keep container port as 8080
ports:
- 4000:80
- 4000:8080
# Set any environmental variables
environment:

View File

@ -35,8 +35,8 @@ const ENDPOINTS = require('./src/utils/defaults').serviceEndpoints; // API endpo
/* Checks if app is running within a container, from env var */
const isDocker = !!process.env.IS_DOCKER;
/* Checks env var for port. If undefined, will use Port 80 for Docker, or 4000 for metal */
const port = process.env.PORT || (isDocker ? 80 : 4000);
/* Checks env var for port. If undefined, will use Port 8080 for Docker, or 4000 for metal */
const port = process.env.PORT || (isDocker ? 8080 : 4000);
/* Attempts to get the users local IP, used as part of welcome message */
const getLocalIp = () => {

View File

@ -12,7 +12,7 @@ module.exports = (app) => {
};
const isDocker = !!process.env.IS_DOCKER;
const SSLPort = process.env.SSL_PORT || (isDocker ? 443 : 4001);
const SSLPort = process.env.SSL_PORT || (isDocker ? 8081 : 4001);
const printSuccess = () => {
console.log(`🔐 HTTPS server successfully started (port: ${SSLPort} ${isDocker ? 'of container' : ''})`);