From c7b17e6136d8774afec79f838705ad4ae3157bd9 Mon Sep 17 00:00:00 2001 From: Zoe Statman-Weil Date: Wed, 21 Aug 2024 08:04:55 -0700 Subject: [PATCH] Fix loading of example data in docker compose (#142) * load docs * updated docs * update change log --------- Co-authored-by: vincentsarago --- CHANGES.md | 2 ++ CONTRIBUTING.md | 14 ++++++++++++++ docker-compose.yml | 15 ++++++--------- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index c9c124e5..e339b0e3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,8 @@ ## [Unreleased] +- Fix Docker compose file, so example data can be loaded into database (author @zstatmanweil, https://github.com/stac-utils/stac-fastapi-pgstac/pull/142) + ## [3.0.0] - 2024-08-02 - Enable filter extension for `GET /items` requests and add `Queryables` links in `/collections` and `/collections/{collection_id}` responses ([#89](https://github.com/stac-utils/stac-fastapi-pgstac/pull/89)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cee65856..42548211 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,6 +16,20 @@ This repo is set to use `pre-commit` to run *isort*, *flake8*, *pydocstring*, *b pre-commit install ``` +To run the service on 0.0.0.0:8082 and ingest example data into the database (the "joplin" collection): + +```shell +make run-joplin +``` + +You can connect to the database with a database tool on port 5439 to inspect and see the data. + +To run the tests: + +```shell +make test +``` + ## Docs ```bash diff --git a/docker-compose.yml b/docker-compose.yml index 8b9f4e6b..d39942ed 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -65,15 +65,12 @@ services: volumes: - ./stac_fastapi:/app/stac_fastapi - ./scripts:/app/scripts - command: - - "./scripts/wait-for-it.sh" - - "-t" - - "60" - - "app:8082" - - "--" - - "python" - - "/app/scripts/ingest_joplin.py" - - "http://app:8082" + command: > + /bin/sh -c " + ./scripts/wait-for-it.sh -t 60 app:8082 && + python -m pip install requests && + python /app/scripts/ingest_joplin.py http://app:8082 + " depends_on: - database - app