From 543a365c584b40447553983ae3c10ec3b342d6f3 Mon Sep 17 00:00:00 2001 From: Tobias Genannt Date: Thu, 25 Nov 2021 11:01:04 +0100 Subject: [PATCH] Added some change from DEV - Pinned unit version to prevent suprises with configuration changes - Added psql client for manage.py dbshell - Set LANG to "C.UTF8" to correctly read configuration files --- Dockerfile | 6 ++++-- docker/nginx-unit.json | 2 +- env/netbox.env | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 64c3fa5..75d82e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,6 +50,7 @@ RUN . /etc/os-release \ ca-certificates \ curl \ openssl \ + postgresql-client \ python3 \ python3-distutils \ && curl -sL https://nginx.org/keys/nginx_signing.key | \ @@ -59,8 +60,8 @@ RUN . /etc/os-release \ && apt-get update -qq \ && apt-get install \ --yes -qq --no-install-recommends \ - unit \ - unit-python3.9 \ + unit=1.26.0-1~bullseye \ + unit-python3.9=1.26.0-1~bullseye \ tini \ && rm -rf /var/lib/apt/lists/* @@ -86,6 +87,7 @@ WORKDIR /opt/netbox # Must set permissions for '/opt/netbox/netbox/media' directory # to g+w so that pictures can be uploaded to netbox. RUN mkdir -p static /opt/unit/state/ /opt/unit/tmp/ \ + && chown -R unit:root /opt/netbox/netbox/media /opt/unit/ \ && chmod -R g+w /opt/netbox/netbox/media /opt/unit/ \ && /opt/netbox/venv/bin/python -m mkdocs build \ --config-file /opt/netbox/mkdocs.yml --site-dir /opt/netbox/netbox/project-static/docs/ \ diff --git a/docker/nginx-unit.json b/docker/nginx-unit.json index fbe8c2b..87a186b 100644 --- a/docker/nginx-unit.json +++ b/docker/nginx-unit.json @@ -11,7 +11,7 @@ "uri": "/static/*" }, "action": { - "share": "/opt/netbox/netbox" + "share": "/opt/netbox/netbox${uri}" } }, diff --git a/env/netbox.env b/env/netbox.env index 1300873..a14afc3 100644 --- a/env/netbox.env +++ b/env/netbox.env @@ -15,6 +15,7 @@ EMAIL_USERNAME=netbox EMAIL_USE_SSL=false EMAIL_USE_TLS=false HOUSEKEEPING_INTERVAL=86400 +LANG=C.UTF-8 MAX_PAGE_SIZE=1000 MEDIA_ROOT=/opt/netbox/netbox/media METRICS_ENABLED=false