-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding route dependencies module. (#251)
**Description:** Generate a list of route dependencies from the environment variable `STAC_FASTAPI_ROUTE_DEPENDENCIES` or the file that this environment variable points to. Feed these route dependencies into the `STACApi` on initialisation. **PR Checklist:** - [x] Code is formatted and linted (run `pre-commit run --all-files`) - [x] Tests pass (run `make test`) - [x] Documentation has been updated to reflect changes, if applicable - [x] Changes are added to the changelog --------- Co-authored-by: Jonathan Healy <[email protected]>
- Loading branch information
1 parent
f4618a9
commit de78fbc
Showing
16 changed files
with
2,499 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
version: '3.9' | ||
|
||
services: | ||
app-elasticsearch: | ||
container_name: stac-fastapi-es | ||
image: stac-utils/stac-fastapi-es | ||
restart: always | ||
build: | ||
context: . | ||
dockerfile: dockerfiles/Dockerfile.dev.es | ||
environment: | ||
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch | ||
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend | ||
- STAC_FASTAPI_VERSION=3.0.0a1 | ||
- APP_HOST=0.0.0.0 | ||
- APP_PORT=8080 | ||
- RELOAD=true | ||
- ENVIRONMENT=local | ||
- WEB_CONCURRENCY=10 | ||
- ES_HOST=elasticsearch | ||
- ES_PORT=9200 | ||
- ES_USE_SSL=false | ||
- ES_VERIFY_CERTS=false | ||
- BACKEND=elasticsearch | ||
- STAC_FASTAPI_ROUTE_DEPENDENCIES=/app/route_dependencies/route_dependencies.json | ||
ports: | ||
- "8080:8080" | ||
volumes: | ||
- ./stac_fastapi:/app/stac_fastapi | ||
- ./examples/route_dependencies:/app/route_dependencies | ||
- ./scripts:/app/scripts | ||
- ./esdata:/usr/share/elasticsearch/data | ||
depends_on: | ||
- elasticsearch | ||
command: | ||
bash -c "./scripts/wait-for-it-es.sh es-container:9200 && python -m stac_fastapi.elasticsearch.app" | ||
|
||
app-opensearch: | ||
container_name: stac-fastapi-os | ||
image: stac-utils/stac-fastapi-os | ||
restart: always | ||
build: | ||
context: . | ||
dockerfile: dockerfiles/Dockerfile.dev.os | ||
environment: | ||
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch | ||
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend | ||
- STAC_FASTAPI_VERSION=2.1 | ||
- APP_HOST=0.0.0.0 | ||
- APP_PORT=8082 | ||
- RELOAD=true | ||
- ENVIRONMENT=local | ||
- WEB_CONCURRENCY=10 | ||
- ES_HOST=opensearch | ||
- ES_PORT=9202 | ||
- ES_USE_SSL=false | ||
- ES_VERIFY_CERTS=false | ||
- BACKEND=opensearch | ||
- STAC_FASTAPI_ROUTE_DEPENDENCIES=/app/route_dependencies/route_dependencies.json | ||
ports: | ||
- "8082:8082" | ||
volumes: | ||
- ./stac_fastapi:/app/stac_fastapi | ||
- ./scripts:/app/scripts | ||
- ./osdata:/usr/share/opensearch/data | ||
depends_on: | ||
- opensearch | ||
command: | ||
bash -c "./scripts/wait-for-it-es.sh os-container:9202 && python -m stac_fastapi.opensearch.app" | ||
|
||
elasticsearch: | ||
container_name: es-container | ||
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-8.11.0} | ||
hostname: elasticsearch | ||
environment: | ||
ES_JAVA_OPTS: -Xms512m -Xmx1g | ||
volumes: | ||
- ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml | ||
- ./elasticsearch/snapshots:/usr/share/elasticsearch/snapshots | ||
ports: | ||
- "9200:9200" | ||
|
||
opensearch: | ||
container_name: os-container | ||
image: opensearchproject/opensearch:${OPENSEARCH_VERSION:-2.11.1} | ||
hostname: opensearch | ||
environment: | ||
- discovery.type=single-node | ||
- plugins.security.disabled=true | ||
- OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m | ||
volumes: | ||
- ./opensearch/config/opensearch.yml:/usr/share/opensearch/config/opensearch.yml | ||
- ./opensearch/snapshots:/usr/share/opensearch/snapshots | ||
ports: | ||
- "9202:9202" | ||
|
||
postgres: | ||
image: postgres:15 | ||
container_name: postgres | ||
hostname: keycloakdb | ||
environment: | ||
- POSTGRES_DB=keycloak | ||
- POSTGRES_USER=keycloak | ||
- POSTGRES_PASSWORD=password | ||
volumes: | ||
- postgres:/var/lib/postgresql/data | ||
|
||
keycloak: | ||
image: quay.io/keycloak/keycloak:25.0.0 | ||
container_name: keycloak | ||
ports: | ||
- 8083:8083 | ||
environment: | ||
- KEYCLOAK_IMPORT=/tmp/keycloak-realm.json | ||
- KEYCLOAK_ADMIN=admin | ||
- KEYCLOAK_ADMIN_PASSWORD=admin | ||
- KC_HTTP_PORT=8083 | ||
- KC_DB=postgres | ||
- KC_DB_URL=jdbc:postgresql://keycloakdb:5432/keycloak | ||
- KC_DB_USERNAME=keycloak | ||
- KC_DB_PASSWORD=password | ||
volumes: | ||
- ./example/route_dependencies/stac-realm.json:/opt/keycloak/data/import | ||
command: start-dev --import-realm | ||
depends_on: | ||
- postgres | ||
|
||
volumes: | ||
postgres: |
Oops, something went wrong.