diff --git a/docker-compose.yaml b/docker-compose.yaml index 5f39eb62..12900b49 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -91,8 +91,12 @@ services: dockerfile: Dockerfile image: backoffice_local_django depends_on: - - postgres-backoffice - - redis + redis: + condition: service_started + postgres-backoffice: + condition: service_started + opensearch: + condition: service_healthy volumes: - ./backoffice:/app:z env_file: @@ -100,7 +104,7 @@ services: - ./backoffice/.envs/local/.postgres ports: - "8000:8000" - command: sh -c 'poetry run python manage.py migrate && poetry run python manage.py runserver 0.0.0.0:8000' + command: sh -c 'poetry run python manage.py migrate && poetry run python manage.py opensearch index create --force && poetry run python manage.py runserver 0.0.0.0:8000' postgres-airflow: image: postgres:13 @@ -170,6 +174,11 @@ services: mem_limit: 2g ports: - "9200:9200" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9200"] + interval: 30s + timeout: 10s + retries: 5 airflow-webserver: <<: *airflow-common