From b44bb98c7e6f4236543c9156fe51cd955269189f Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Tue, 26 Mar 2024 14:19:51 -0400 Subject: [PATCH] Dockerfile: Fix collectstatic command (#15035) Recent changes in awx and/or django ansible base cause the django collectstatic command to fail when using an empty settings file. Instead, use the defaults settings file from controller via DJANGO_SETTINGS_MODULE=awx.settings.defaults [linux/amd64 builder 13/13] RUN AWX_SETTINGS_FILE=/dev/null SKIP_SECRET_KEY_CHECK=yes SKIP_PG_VERSION_CHECK=yes /var/lib/awx/venv/awx/bin/awx-manage collectstatic --noinput --clear Traceback (most recent call last): (...) django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details. Signed-off-by: Dimitri Savineau --- tools/ansible/roles/dockerfile/templates/Dockerfile.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ansible/roles/dockerfile/templates/Dockerfile.j2 b/tools/ansible/roles/dockerfile/templates/Dockerfile.j2 index 12e791f07d62..f2538990c113 100644 --- a/tools/ansible/roles/dockerfile/templates/Dockerfile.j2 +++ b/tools/ansible/roles/dockerfile/templates/Dockerfile.j2 @@ -90,7 +90,7 @@ WORKDIR /tmp/src/ RUN make sdist && /var/lib/awx/venv/awx/bin/pip install dist/awx.tar.gz {% if not headless|bool %} -RUN AWX_SETTINGS_FILE=/dev/null SKIP_SECRET_KEY_CHECK=yes SKIP_PG_VERSION_CHECK=yes /var/lib/awx/venv/awx/bin/awx-manage collectstatic --noinput --clear +RUN DJANGO_SETTINGS_MODULE=awx.settings.defaults SKIP_SECRET_KEY_CHECK=yes SKIP_PG_VERSION_CHECK=yes /var/lib/awx/venv/awx/bin/awx-manage collectstatic --noinput --clear {% endif %} {% endif %}