diff --git a/auth/keycloak/eoapi-realm.json b/demo/keycloak/eoapi-realm.json similarity index 100% rename from auth/keycloak/eoapi-realm.json rename to demo/keycloak/eoapi-realm.json diff --git a/auth/keycloak/eoapi-users-0.json b/demo/keycloak/eoapi-users-0.json similarity index 100% rename from auth/keycloak/eoapi-users-0.json rename to demo/keycloak/eoapi-users-0.json diff --git a/docker-compose.custom.yml b/docker-compose.custom.yml index 09880d1..add2e0b 100644 --- a/docker-compose.custom.yml +++ b/docker-compose.custom.yml @@ -20,6 +20,8 @@ services: build: context: . dockerfile: dockerfiles/Dockerfile.stac + args: + - INSTALL_EXTRA=[jwt] ports: - "${MY_DOCKER_IP:-127.0.0.1}:8081:8081" environment: @@ -49,6 +51,10 @@ services: # PgSTAC extensions # - EOAPI_STAC_EXTENSIONS=["filter", "query", "sort", "fields", "pagination", "context", "transaction"] # - EOAPI_STAC_CORS_METHODS='GET,POST,PUT,OPTIONS' + - KEYCLOAK_REALM=eoapi + - KEYCLOAK_HOST=http://localhost:8080 + - KEYCLOAK_CLIENT_ID=stac-api + - KEYCLOAK_INTERNAL_HOST=http://keycloak:8080 depends_on: - database - raster @@ -276,6 +282,20 @@ services: command: postgres -N 500 volumes: - ./.pgdata:/var/lib/postgresql/data + + keycloak: + profiles: + - keycloak + image: quay.io/keycloak/keycloak:latest + environment: + KEYCLOAK_ADMIN: admin + KEYCLOAK_ADMIN_PASSWORD: admin + ports: + - "8080:8080" + - "9990:9990" + command: start-dev --import-realm + volumes: + - ./demo/keycloak:/opt/keycloak/data/import networks: default: diff --git a/docker-compose.yml b/docker-compose.yml index 9ea5857..f43fec0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,7 +27,7 @@ services: # Application - HOST=0.0.0.0 - PORT=8081 - - MODULE_NAME=eoapi.stac.app + - MODULE_NAME=stac_fastapi.pgstac.app - VARIABLE_NAME=app # gunicorn # https://github.com/tiangolo/uvicorn-gunicorn-docker#web_concurrency @@ -145,18 +145,6 @@ services: volumes: - ./.pgdata:/var/lib/postgresql/data - keycloak: - image: quay.io/keycloak/keycloak:latest - environment: - KEYCLOAK_ADMIN: admin - KEYCLOAK_ADMIN_PASSWORD: admin - ports: - - "8080:8080" - - "9990:9990" - command: start-dev --import-realm - volumes: - - ./auth/keycloak:/opt/keycloak/data/import - networks: default: name: eoapi-network diff --git a/dockerfiles/Dockerfile.stac b/dockerfiles/Dockerfile.stac index aef10ae..643f66c 100644 --- a/dockerfiles/Dockerfile.stac +++ b/dockerfiles/Dockerfile.stac @@ -2,10 +2,12 @@ ARG PYTHON_VERSION=3.11 FROM ghcr.io/vincentsarago/uvicorn-gunicorn:${PYTHON_VERSION} +ARG INSTALL_EXTRA= + ENV CURL_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt COPY runtime/eoapi/stac /app/stac -RUN pip install -e "/app/stac[jwt]" +RUN pip install -e "/app/stac${INSTALL_EXTRA}" ENV MODULE_NAME eoapi.stac.app ENV VARIABLE_NAME app