Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ COPY plugin_requirements.txt /opt/netbox/
RUN /usr/local/bin/uv pip install -r /opt/netbox/plugin_requirements.txt

COPY configuration/plugins.py /etc/netbox/config/plugins.py
COPY configuration/base_path.py /etc/netbox/config/base_path.py
COPY configuration/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY entrypoint.sh /opt/netbox/entrypoint.sh
COPY docker/entrypoint.sh /opt/netbox/entrypoint.sh
COPY docker/launch-netbox.sh /opt/netbox/launch-netbox.sh

LABEL internal_version="4.6.1.0"
LABEL internal_version="4.6.1.1"
LABEL prometheus_scrape="true"
LABEL prometheus_address="netbox:8080"

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ On your favorite terminal (that we know the best terminal is
env TAG=latest IMAGE=saashup/netbox-docker docker compose up -d
```

Unlike [the official Netbox Docker distribution](https://github.com/netbox-community/netbox-docker), we have acivated the [BASE_PATH](https://netboxlabs.com/docs/netbox/configuration/system/#base_path) environment variable.

# Hosting
Check https://saashup.com for more information.
3 changes: 3 additions & 0 deletions configuration/base_path.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from os import environ

BASE_PATH = environ.get("BASE_PATH", "")
File renamed without changes.
29 changes: 29 additions & 0 deletions docker/launch-netbox.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

if [ -n "$BASE_PATH" ]; then
STATIC_PATH="/${BASE_PATH}static"
else
STATIC_PATH="/static"
fi

echo $STATIC_PATH

exec granian \
--host "::" \
--port "8080" \
--interface "wsgi" \
--no-ws \
--workers "${GRANIAN_WORKERS:-4}" \
--respawn-failed-workers \
--backpressure "${GRANIAN_BACKPRESSURE:-${GRANIAN_WORKERS:-4}}" \
--loop "uvloop" \
--log \
--log-level "info" \
--access-log \
--working-dir "/opt/netbox/netbox/" \
--static-path-route "${STATIC_PATH}" \
--static-path-mount "/opt/netbox/netbox/static/" \
--static-path-dir-to-file index.html \
--pid-file "/tmp/granian.pid" \
"${GRANIAN_EXTRA_ARGS[@]}" \
"netbox.granian:application"
Loading