From ae6e479db02c884f4b582371ba2110fc706daeb7 Mon Sep 17 00:00:00 2001
From: Tobias Genannt <tobias.genannt@gmail.com>
Date: Wed, 21 Jul 2021 09:58:27 +0200
Subject: [PATCH] Build documentation files in the image

---
 Dockerfile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Dockerfile b/Dockerfile
index 68f41f520..c636a04f9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -74,6 +74,8 @@ WORKDIR /opt/netbox/netbox
 # to g+w so that pictures can be uploaded to netbox.
 RUN mkdir -p static /opt/unit/state/ /opt/unit/tmp/ \
       && chmod -R g+w media /opt/unit/ \
+      && cd /opt/netbox/ && /opt/netbox/venv/bin/python -m mkdocs build \
+          --config-file /opt/netbox/mkdocs.yml --site-dir /opt/netbox/netbox/project-static/docs/ \
       && SECRET_KEY="dummy" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input
 
 ENTRYPOINT [ "/opt/netbox/docker-entrypoint.sh" ]