Commit 5bfb6965 authored by Evili del Rio's avatar Evili del Rio

Add django-health-checks

parent 7ff61947
Pipeline #622 canceled with stages
in 5 minutes and 20 seconds
......@@ -18,6 +18,7 @@ RUN apk update && \
${dev_packages} && \
pip install gunicorn \
"django${django_version}" \
django-health-check \
psycopg2-binary mysql-connector whitenoise[brotli] && \
apk del ${dev_packages} && \
apk add ${lib_packages} && \
......@@ -32,5 +33,6 @@ EXPOSE 5000/tcp
COPY environment_settings.py /
COPY entrypoint.sh /
COPY health_urls.py /settings
ENTRYPOINT ["/entrypoint.sh"]
......@@ -61,3 +61,19 @@ if os.getenv('DJANGO_DATABASES', None) is None:
'PASSWORD' : os.getenv('DJANGO_DATABASE_PASSWORD', os.getenv('POSTGRES_PASSWORD', __PROJECT_NAME)),
}
}
#
# Add django-health-check to INSTALLED_APPS
#
INSTALLED_APPS.extend([
'health_check',
'health_check.db',
'health_check.cache',
'health_check.storage',
])
#
# Substitue ROOT_URLCONF to include health checks
#
PROJECT_ROOT_URLCONF = ROOT_URLCONF
ROOT_URLCONF = 'health_urls'
from django.conf import settings
from django.urls import path, include
urlpatterns = [
path('health_checks', include('health_check.urls')),
path('', include(settings.PROJECT_ROOT_URLCONF)),
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment