diff --git a/compose.example.yml b/compose.example.yml new file mode 100644 index 0000000..4f21293 --- /dev/null +++ b/compose.example.yml @@ -0,0 +1,50 @@ +include: + - ./compose.yml + +services: + example: + build: + context: ./ + dockerfile: docker/Dockerfile.biodm-test-api + args: + - PYTHON__V=3.11 + - KEEPENV=1 + extra_hosts: + - "host.minikube.internal:10.10.0.3" + healthcheck: + test: python3 -c "import requests; exit(requests.get('http://example:8000/live').text != 'live\n');" + interval: 5s + timeout: 5s + retries: 10 + depends_on: + api-db: + condition: service_healthy + keycloak: + condition: service_healthy + s3bucket: + condition: service_healthy + ports: + - 8000:8000 + stdin_open: true + tty: true + networks: + biodm-dev: + ipv4_address: 10.10.0.6 + # networks: + # biodm-dev: + # aliases: + # # - example.local + # - host.docker.internal + + example-swagger-ui: + image: swaggerapi/swagger-ui:v5.17.14 + ports: + - "9080:8080" + depends_on: + example: + condition: service_healthy + environment: + API_URL: http://host.docker.internal:8000/schema + networks: + biodm-dev: + ipv4_address: 10.10.0.7 diff --git a/compose.test.yml b/compose.test.yml index 787e846..c73e6f9 100644 --- a/compose.test.yml +++ b/compose.test.yml @@ -2,29 +2,6 @@ include: - ./compose.yml services: - example: - build: - context: ./ - dockerfile: docker/Dockerfile.biodm-test-api - args: - - PYTHON__V=3.11 - - KEEPENV=1 - extra_hosts: - - "host.minikube.internal:10.10.0.3" - depends_on: - api-db: - condition: service_healthy - keycloak: - condition: service_healthy - swagger-ui: - condition: service_started - ports: - - 8000:8000 - stdin_open: true - tty: true - networks: - - biodm-dev - test-keycloak-env: build: context: ./ diff --git a/src/biodm/api.py b/src/biodm/api.py index f7ef851..2c77424 100644 --- a/src/biodm/api.py +++ b/src/biodm/api.py @@ -173,7 +173,7 @@ def __init__( self.add_middleware(AuthenticationMiddleware) self.add_middleware( CORSMiddleware, allow_credentials=True, - allow_origins=self._network_ips + ["http://localhost:9080"], # + swagger-ui. + allow_origins=["*"], # self._network_ips + ["http://localhost:9080"], # + swagger-ui. allow_methods=["*"], allow_headers=["*"], max_age=config.CACHE_MAX_AGE