diff --git a/.devcontainer/docker-compose.dev.yml b/.devcontainer/docker-compose.dev.yml index f34b119..95a1704 100644 --- a/.devcontainer/docker-compose.dev.yml +++ b/.devcontainer/docker-compose.dev.yml @@ -8,7 +8,8 @@ services: - DEVCONTAINER_SERVICE=${DEVCONTAINER_SERVICE} - ENV=LOCAL ports: - - 8081:8080 + - 8081:8080 # FastAPI + - 8678:8678 # Debugpy volumes: - type: bind source: ${LOCAL_ENV_HOME}/.aws @@ -18,6 +19,11 @@ services: target: /root/.config/gcloud env_file: - .env + logging: + driver: "local" + options: + max-size: "10m" + max-file: "3" burn_backend: build: @@ -27,7 +33,8 @@ services: - DEVCONTAINER_SERVICE=${DEVCONTAINER_SERVICE} - ENV=LOCAL ports: - - 5051:5050 + - 5051:5050 # FastAPI + - 5678:5678 # Debugpy volumes: - type: bind source: ${LOCAL_ENV_HOME}/.aws @@ -37,3 +44,8 @@ services: target: /root/.config/gcloud env_file: - .env + logging: + driver: "local" + options: + max-size: "10m" + max-file: "3" \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 4914480..bac7f4b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -17,6 +17,21 @@ "python": "/opt/conda/envs/burn-severity-prod/bin/python", "console": "integratedTerminal" }, + { + "name": "Python: Attach to Docker Burn Backend", + "type": "debugpy", + "request": "attach", + "connect": { + "host": "localhost", + "port": 5678 + }, + "pathMappings": [ + { + "localRoot": "${workspaceFolder}", + "remoteRoot": "/workspace" + } + ] + }, { "name": "Python: TiTiler FastAPI", "type": "debugpy", @@ -33,33 +48,18 @@ "python": "/opt/conda/envs/titiler-prod/bin/python", "console": "integratedTerminal" }, - { - "name": "Python: Attach to Docker Burn Backend", - "type": "debugpy", - "request": "attach", - "connect": { - "host": "localhost", - "port": 5678 - }, - "pathMappings": [ - { - "localRoot": "${workspaceFolder}", - "remoteRoot": "/workspace/src/burn_backend" - } - ] - }, { "name": "Python: Attach to Docker TiTiler", "type": "debugpy", "request": "attach", "connect": { "host": "localhost", - "port": 5678 + "port": 8678 }, "pathMappings": [ { "localRoot": "${workspaceFolder}", - "remoteRoot": "/workspace/src/titiler" + "remoteRoot": "/workspace" } ] } diff --git a/src/burn_backend/app.py b/src/burn_backend/app.py index 3e9316f..8d5cfe4 100644 --- a/src/burn_backend/app.py +++ b/src/burn_backend/app.py @@ -14,6 +14,7 @@ ## APP SETUP ## app = FastAPI(docs_url="/documentation") +print(os.getenv("ENV")) ## CORS / LOCAL DEV ## if os.getenv("ENV") == "LOCAL": diff --git a/src/titiler/app.py b/src/titiler/app.py index 73c25c7..15e1e0e 100644 --- a/src/titiler/app.py +++ b/src/titiler/app.py @@ -10,11 +10,13 @@ from src.titiler.routers.pages import home, map, upload, directory ## LOCAL DEV ## +print(os.getenv("ENV")) + if os.getenv("ENV") == "LOCAL": # Set up debugpy import debugpy - debugpy.listen(("0.0.0.0", 5678)) + debugpy.listen(("0.0.0.0", 8678)) print("Waiting for debugger attach...") debugpy.wait_for_client() print("Debugger attached")