mirror of
https://github.com/netbox-community/netbox-docker.git
synced 2025-07-01 07:00:15 +02:00
Make startup scripts optional
To optimize the application boot time the startup scripts can now be disabled by an ENV variable. The default when the variable is not set, is to run the startup scripts. This means that the default behaviour is not changed from earlier releases.
This commit is contained in:
@ -39,10 +39,14 @@ if not User.objects.filter(username='${SUPERUSER_NAME}'):
|
||||
Token.objects.create(user=u, key='${SUPERUSER_API_TOKEN}')
|
||||
END
|
||||
|
||||
for script in /opt/netbox/startup_scripts/*.py; do
|
||||
echo "⚙️ Executing '$script'"
|
||||
./manage.py shell --interface python < "${script}"
|
||||
done
|
||||
if [ "$SKIP_STARTUP_SCRIPTS" == "true" ]; then
|
||||
echo "☇ Skipping startup scripts"
|
||||
else
|
||||
for script in /opt/netbox/startup_scripts/*.py; do
|
||||
echo "⚙️ Executing '$script'"
|
||||
./manage.py shell --interface python < "${script}"
|
||||
done
|
||||
fi
|
||||
|
||||
# copy static files
|
||||
./manage.py collectstatic --no-input
|
||||
|
Reference in New Issue
Block a user