add health check

This commit is contained in:
2023-10-30 12:11:06 +01:00
parent cf6213cca3
commit acee6b0686
4 changed files with 10 additions and 4 deletions

View File

@@ -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