Skip to content

Commit

Permalink
Fix: docker startup (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman authored Jan 28, 2025
2 parents 29a60d6 + 9e955fa commit 3c9658e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion appcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ RUN pip install $(find /build/dist -name ca_disaster_recovery*.whl)

# configure container executable
ENTRYPOINT ["/bin/bash"]
CMD ["bin/start.sh"]
CMD ["bin/reset_db.sh"]
2 changes: 2 additions & 0 deletions bin/reset_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ if [[ -n "$valid_fixtures" ]]; then
else
echo "No JSON fixtures to load"
fi

bin/start.sh
2 changes: 1 addition & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def main():
if len(sys.argv) == 2 and sys.argv[1] == "--version" or sys.argv[1] == "-v":
from web import __version__

print(f"ddrc-web, {__version__}")
print(f"ca-disaster-recovery, {__version__}")
return

try:
Expand Down
16 changes: 10 additions & 6 deletions web/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@
https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/
"""

import logging
import os

from django.core.wsgi import get_wsgi_application
from django.urls import include, path


from web.core.models import UserFlow
import web.urls

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "web.settings")

logger = logging.getLogger(__name__)
application = get_wsgi_application()

for flow in UserFlow.objects.all():
web.urls.urlpatterns.append(path(f"{flow.system_name}/", include(flow.urlconf_path)))
try:
import web.urls
from web.core.models import UserFlow

for flow in UserFlow.objects.all():
web.urls.urlpatterns.append(path(f"{flow.system_name}/", include(flow.urlconf_path)))
except Exception as ex:
logger.error(ex)

0 comments on commit 3c9658e

Please sign in to comment.