Browse Source

refactor: Re-add backend debug port configuration

Owen Diffey 1 month ago
parent
commit
30fd642238
5 changed files with 6 additions and 1 deletions
  1. 1 0
      .env.example
  2. 1 0
      .wiki/Configuration.md
  3. 1 1
      backend/entrypoint.dev.sh
  4. 1 0
      compose.dev.yml
  5. 2 0
      compose.local.yml

+ 1 - 0
.env.example

@@ -5,6 +5,7 @@ CONTAINER_MODE=production
 APP_ENV=production
 
 BACKEND_DEBUG=false
+BACKEND_DEBUG_PORT=9229
 
 FRONTEND_CLIENT_PORT=80
 FRONTEND_DEV_PORT=81

+ 1 - 0
.wiki/Configuration.md

@@ -19,6 +19,7 @@ environment variables yourself.
 | `CONTAINER_MODE` | Should be either `production` or `local`.  |
 | `APP_ENV` | Should be either `production` or `development`.  |
 | `BACKEND_DEBUG` | Should be either `true` or `false`. If enabled backend will await debugger connection and trigger to start. |
+| `BACKEND_DEBUG_PORT` | Backend container debug port, if enabled. |
 | `FRONTEND_CLIENT_PORT` | Should be the port on which the frontend will be accessible from, usually port `80`, or `443` if using SSL. Only used when running in development mode. |
 | `FRONTEND_DEV_PORT` | Should be the port where Vite's dev server will be accessible from, should always be port `81` for Docker since nginx listens on port 80, and is recommended to be port `80` for non-Docker. Only used when running in development mode. |
 | `FRONTEND_PROD_DEVTOOLS` | Whether to enable Vue dev tools in production builds. [^1] |

+ 1 - 1
backend/entrypoint.dev.sh

@@ -7,7 +7,7 @@ if [ ! -d node_modules ]; then
 fi
 
 if [ "${BACKEND_DEBUG}" = "true" ]; then
-    export INSPECT_BRK="--inspect-brk=0.0.0.0:9229"
+    export INSPECT_BRK="--inspect-brk=0.0.0.0:${BACKEND_DEBUG_PORT:-9229}"
 else
     export INSPECT_BRK=""
 fi

+ 1 - 0
compose.dev.yml

@@ -5,6 +5,7 @@ services:
     environment:
       - APP_ENV=${APP_ENV:-development}
       - BACKEND_DEBUG=${BACKEND_DEBUG:-false}
+      - BACKEND_DEBUG_PORT=${BACKEND_DEBUG_PORT:-9229}
 
   frontend:
     build:

+ 2 - 0
compose.local.yml

@@ -5,6 +5,8 @@ services:
       - ./common:/opt/common
       - ./types:/opt/types
       - ./backend:/opt/app
+    ports:
+      - ${BACKEND_DEBUG_PORT:-9229}:${BACKEND_DEBUG_PORT:-9229}"
 
   frontend:
     volumes: