From 5acf99c76801d55bb593e8d1478fb7b3e0bd3e63 Mon Sep 17 00:00:00 2001 From: Akiff Manji Date: Wed, 4 Sep 2024 10:06:29 -0700 Subject: [PATCH] refactor: debugpy is configured by environment variable Signed-off-by: Akiff Manji --- docker/docker-compose-debug.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docker/docker-compose-debug.yml b/docker/docker-compose-debug.yml index b913be70b..b6f488df0 100644 --- a/docker/docker-compose-debug.yml +++ b/docker/docker-compose-debug.yml @@ -1,11 +1,14 @@ -version: '3' +version: "3" services: vcr-api: - command: ["sh", "-c", "pip install debugpy -t /tmp && python ./manage.py migrate && python /tmp/debugpy --wait-for-client --listen 0.0.0.0:5678 ./manage.py runserver 0.0.0.0:8080"] + environment: + - DEBUGPY=${DEBUGPY} + command: > + sh -c "python ./manage.py migrate && if [ ! -z $DEBUGPY ]; then pip install debugpy -t /tmp && python /tmp/debugpy --wait-for-client --listen 0.0.0.0:5678 ./manage.py runserver 0.0.0.0:8080; else python ./manage.py runserver 0.0.0.0:8080; fi" volumes: - ../server/vcr-server/vcr_server:/opt/app-root/src/vcr_server - ../server/vcr-server/subscriptions:/opt/app-root/src/subscriptions - ../server/vcr-server/agent_webhooks:/opt/app-root/src/agent_webhooks - ../server/vcr-server/api:/opt/app-root/src/api ports: - - 5678:5678 \ No newline at end of file + - 5678:5678