Skip to content

Commit

Permalink
Debug compose for macos attempt no3
Browse files Browse the repository at this point in the history
  • Loading branch information
Etienne Jodry authored and Etienne Jodry committed Sep 17, 2024
1 parent e3f2afe commit e156cd4
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 24 deletions.
50 changes: 50 additions & 0 deletions compose.example.yml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 0 additions & 23 deletions compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ./
Expand Down
2 changes: 1 addition & 1 deletion src/biodm/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e156cd4

Please sign in to comment.