Skip to content

Commit 7902fe0

Browse files
committed
Try and fix the docker-compose serving
1 parent 26c318a commit 7902fe0

File tree

6 files changed

+10
-3
lines changed

6 files changed

+10
-3
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ tools/generated/*
4949

5050
# generated ssl certs
5151
compose/ingress/certs/*
52+
53+
# static files
54+
test_app/static/

test_app/scripts/container_startup_uwsgi.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ echo "settings.DATABASE ..."
1212
$PYTHON manage.py shell -c 'from django.conf import settings; print(settings.DATABASES)'
1313

1414
$PYTHON manage.py migrate
15+
$PYTHON manage.py collectstatic
1516
DJANGO_SUPERUSER_PASSWORD=password DJANGO_SUPERUSER_USERNAME=admin [email protected] $PYTHON manage.py createsuperuser --noinput || true
1617
$PYTHON manage.py authenticators --initialize
1718
$PYTHON manage.py create_demo_data

test_app/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@
157157
ANSIBLE_BASE_TEAM_MODEL = 'test_app.Team'
158158
ANSIBLE_BASE_ORGANIZATION_MODEL = 'test_app.Organization'
159159

160+
STATIC_ROOT = os.path.join(BASE_DIR, 'test_app', 'static')
160161
STATIC_URL = '/static/'
161162

162163
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

test_app/urls.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from django.contrib import admin
22
from django.urls import include, path, re_path
3+
from django.conf.urls.static import static
4+
from django.conf import settings
35

46
from ansible_base.authentication.views.ui_auth import UIAuth
57
from ansible_base.lib.dynamic_config.dynamic_urls import api_urls, api_version_urls, root_urls
@@ -22,4 +24,4 @@
2224
path('api/v1/timeout_view/', views.timeout_view, name='test-timeout-view'),
2325
path('login/', include('rest_framework.urls')),
2426
path("__debug__/", include("debug_toolbar.urls")),
25-
]
27+
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

test_app/uwsgi.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ chmod-socket = 660
77
vacuum = true
88

99
# Log to stdout
10-
logto = /dev/stdout
10+
# logto = /dev/stdout
1111
log-master = true
1212
#disable-logging = true
1313

tools/dev_postgres/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ ENV POSTGRES_PASSWORD=dabing
66

77
EXPOSE 5432
88

9-
HEALTHCHECK --interval=10s --timeout=5s --retries=5 CMD ["pg_isready", "-U", "$${POSTGRES_USER}", "-d", "$${POSTGRES_DB}"]
9+
HEALTHCHECK --interval=10s --timeout=5s --retries=5 CMD ["pg_isready", "-U", "dab", "-d", "dab_db"]

0 commit comments

Comments
 (0)