Skip to content

Commit

Permalink
Merge pull request #54 from CompPhy/master
Browse files Browse the repository at this point in the history
Make nginx port configurable through ENV variable.
  • Loading branch information
antonym authored Jan 19, 2024
2 parents d09e861 + 959f24b commit 9403f99
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN \
bash \
busybox \
curl \
envsubst \
git \
jq \
nghttp2-dev \
Expand Down Expand Up @@ -46,6 +47,7 @@ RUN \
rm -rf /tmp/*

ENV TFTPD_OPTS=''
ENV NGINX_PORT='80'

EXPOSE 3000

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ The following snippets are examples of starting up the container.
docker run -d \
--name=netbootxyz \
-e MENU_VERSION=2.0.59 `# optional` \
-e NGINX_PORT=80 `# optional` \
-p 3000:3000 `# sets webapp port` \
-p 69:69/udp `# sets tftp port` \
-p 8080:80 `# optional` \
-p 8080:80 `# optional, destination should match ${NGINX_PORT} variable above.` \
-v /local/path/to/config:/config `# optional` \
-v /local/path/to/assets:/assets `# optional` \
--restart unless-stopped \
Expand Down Expand Up @@ -139,7 +140,6 @@ INTERFACESv4="eth0"

You'll also need a `/etc/dhcp/dhcpd.conf` looking something like this:


```shell
option arch code 93 = unsigned integer 16;

Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ services:
container_name: netbootxyz
environment:
- MENU_VERSION=2.0.47 # optional
- NGINX_PORT=80 # optional
volumes:
- /path/to/config:/config # optional
- /path/to/assets:/assets # optional
ports:
- 3000:3000
- 69:69/udp
- 8080:80 #optional
- 8080:80 # optional, destination should match ${NGINX_PORT} variable above.
restart: unless-stopped
2 changes: 1 addition & 1 deletion root/defaults/default
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server {
listen 80;
listen ${NGINX_PORT};
location / {
root /assets;
autoindex on;
Expand Down
6 changes: 3 additions & 3 deletions root/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ mkdir -p \
[[ ! -f /config/nginx/nginx.conf ]] && \
cp /defaults/nginx.conf /config/nginx/nginx.conf
[[ ! -f /config/nginx/site-confs/default ]] && \
cp /defaults/default /config/nginx/site-confs/default
envsubst < /defaults/default > /config/nginx/site-confs/default

# Ownership
chown -R nbxyz:nbxyz /assets
chown -R nbxyz:nbxyz /var/lib/nginx
Expand All @@ -27,7 +27,7 @@ mkdir -p \

# download menus if not found
if [[ ! -f /config/menus/remote/menu.ipxe ]]; then
if [[ -z ${MENU_VERSION+x} ]]; then \
if [[ -z ${MENU_VERSION+x} ]]; then \
MENU_VERSION=$(curl -sL "https://api.github.com/repos/netbootxyz/netboot.xyz/releases/latest" | jq -r '.tag_name')
fi
echo "[netbootxyz-init] Downloading netboot.xyz at ${MENU_VERSION}"
Expand Down

0 comments on commit 9403f99

Please sign in to comment.