Make web app port configurable.

This commit is contained in:
Kelly Shutt 2024-02-02 08:10:30 -05:00
parent 2a36c1a8e0
commit c4014a0a6e
4 changed files with 8 additions and 4 deletions

View File

@ -48,6 +48,7 @@ RUN \
ENV TFTPD_OPTS=''
ENV NGINX_PORT='80'
ENV WEB_APP_PORT='3000'
EXPOSE 3000

View File

@ -58,7 +58,8 @@ docker run -d \
--name=netbootxyz \
-e MENU_VERSION=2.0.76 `# optional` \
-e NGINX_PORT=80 `# optional` \
-p 3000:3000 `# sets webapp port` \
-e WEB_APP_PORT=3000 `# optional` \
-p 3000:3000 `# sets web configuration interface port, destination should match ${WEB_APP_PORT} variable above.` \
-p 69:69/udp `# sets tftp port` \
-p 8080:80 `# optional, destination should match ${NGINX_PORT} variable above.` \
-v /local/path/to/config:/config `# optional` \
@ -112,6 +113,7 @@ Container images are configured using parameters passed at runtime (such as thos
| `-p 3000` | Web configuration interface. |
| `-p 69/udp` | TFTP Port. |
| `-p 80` | NGINX server for hosting assets. |
| `-e WEB_APP_PORT=3000` | Specify a different port for the web configuration interface to listen on. |
| `-e NGINX_PORT=80` | Specify a different port for NGINX service to listen on. |
| `-e MENU_VERSION=2.0.76` | Specify a specific version of boot files you want to use from netboot.xyz (unset pulls latest) |
| `-v /config` | Storage for boot menu files and web application config |

View File

@ -7,11 +7,12 @@ services:
environment:
- MENU_VERSION=2.0.47 # optional
- NGINX_PORT=80 # optional
- WEB_APP_PORT=3000 # optional
volumes:
- /path/to/config:/config # optional
- /path/to/assets:/assets # optional
ports:
- 3000:3000
- 3000:3000 # optional, destination should match ${WEB_APP_PORT} variable above.
- 69:69/udp
- 8080:80 # optional, destination should match ${NGINX_PORT} variable above.
restart: unless-stopped

View File

@ -15,7 +15,7 @@ daemon=off
priority = 2
[program:webapp]
environment=NODE_ENV="production",PORT=3000
environment=NODE_ENV="production",PORT=%(ENV_WEB_APP_PORT)s
command=/usr/bin/node app.js
user=nbxyz
directory=/app