add health check
This commit is contained in:
@@ -23,7 +23,7 @@ services:
|
||||
env_file:
|
||||
- .env
|
||||
ports:
|
||||
- 8000:8000
|
||||
- "8000:8000"
|
||||
user: "1000:1000"
|
||||
volumes:
|
||||
- ./marbas:/app/marbas
|
||||
@@ -32,6 +32,9 @@ services:
|
||||
- ./manage.py:/app/manage.py
|
||||
- ./static_eve:/app/static_eve
|
||||
command: ["uvicorn", "marbas.asgi:application", "--host", "0.0.0.0", "--port", "8000", "--reload"]
|
||||
healthcheck:
|
||||
test: python manage.py health_check
|
||||
interval: 3s
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
@@ -45,7 +48,7 @@ services:
|
||||
redis:
|
||||
image: redis:latest
|
||||
ports:
|
||||
- 6379:6379
|
||||
- "6379:6379"
|
||||
healthcheck:
|
||||
test: redis-cli ping
|
||||
interval: 3s
|
||||
@@ -53,7 +56,7 @@ services:
|
||||
db:
|
||||
image: postgres:13-alpine
|
||||
ports:
|
||||
- 5432:5432
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- marbas_dbdata:/var/lib/postgresql/data
|
||||
env_file:
|
||||
@@ -67,7 +70,7 @@ services:
|
||||
# elasticsearch:
|
||||
# image: elasticsearch:latest
|
||||
# ports:
|
||||
# - 9200:9200
|
||||
# - "9200:9200"
|
||||
# environment:
|
||||
# - discovery.type=single-node
|
||||
# - cluster.name=elasticsearch
|
||||
|
||||
@@ -55,6 +55,7 @@ INSTALLED_APPS = [
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'django_filters',
|
||||
'health_check',
|
||||
'rest_framework'
|
||||
]
|
||||
|
||||
|
||||
@@ -37,4 +37,5 @@ urlpatterns = [
|
||||
template_name='redoc.html',
|
||||
extra_context={'schema_url': 'openapi-schema'}
|
||||
), name='redoc'),
|
||||
path('ht/', include('health_check.urls')),
|
||||
]
|
||||
|
||||
@@ -8,3 +8,4 @@ redis
|
||||
pyyaml
|
||||
uritemplate
|
||||
django-esi
|
||||
django-health-check
|
||||
|
||||
Reference in New Issue
Block a user