Reputation: 55
In order for django-elastic-dsl to index the documents we have to run python manage.py search_index --rebuild
on every deploy. so I faced an issue having docker-compose executing my django project and that is:
File "/root/.local/share/virtualenvs/django-lHo0u5mj/lib/python3.11/site-packages/django_elasticsearch_dsl/management/commands/search_index.py", line 172, in _delete
2023-08-20T13:58:47.033526087Z response = input(
2023-08-20T13:58:47.033533712Z ^^^^^^
2023-08-20T13:58:47.033537712Z EOFError: EOF when reading a line
apparently this command is prompting an input from the user and it's called on every docker-compose build command, here is my start.sh file:
#!/usr/bin/env bash
pipenv run python manage.py makemigrations
pipenv run python manage.py migrate
pipenv run python manage.py search_index --rebuild
#pipenv run python manage.py collectstatic --no-input
pipenv run gunicorn --reload --bind 0.0.0.0:8000 service_monitoring.wsgi:application
What is the workaround of not running the command manually every time I start the container?
Upvotes: 0
Views: 190