Skip to content

Commit

Permalink
Merge pull request #57 from CompPhy/master
Browse files Browse the repository at this point in the history
Make web app port configurable.
  • Loading branch information
antonym committed Feb 5, 2024
2 parents 8cb28ab + c4014a0 commit de524f8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ RUN \

ENV TFTPD_OPTS=''
ENV NGINX_PORT='80'
ENV WEB_APP_PORT='3000'

EXPOSE 69/udp
EXPOSE 80
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` \
Expand Down Expand Up @@ -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 |
Expand Down
5 changes: 3 additions & 2 deletions docker-compose.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -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.
- 8080:80 # optional, destination should match ${NGINX_PORT} variable above.
restart: unless-stopped
2 changes: 1 addition & 1 deletion root/etc/supervisor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit de524f8

Please sign in to comment.