Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
fix(one-app-runner): apply anonymous ip to debugger (#559)
Browse files Browse the repository at this point in the history
Co-authored-by: Jonny Adshead <[email protected]>
  • Loading branch information
drewcur and JAdshead authored Sep 7, 2023
1 parent c64b3ee commit 8443acc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ exports[`startApp Displays an error if createNetwork fails: create network calls

exports[`startApp Passes the container name to the docker --name flag 1`] = `"docker pull one-app:5.0.0 && docker run -t -p 3000:3000 -p 3001:3001 -p 3002:3002 -p 3005:3005 -p 9229:9229 -e NODE_ENV=development --name=one-app-at-test -v \\"/path/to/module-a:/opt/module-workspace/module-a\\" one-app:5.0.0 /bin/sh -c \\"npm run serve-module '/opt/module-workspace/module-a' && node lib/server/index.js --root-module-name=frank-lloyd-root --module-map-url=https://example.com/module-map.json \\""`;

exports[`startApp applies inspect mode to node process when useDebug is passed 1`] = `"docker pull one-app:5.0.0 && docker run -t -p 3000:3000 -p 3001:3001 -p 3002:3002 -p 3005:3005 -p 9229:9229 -e NODE_ENV=development -v \\"/path/to/module-a:/opt/module-workspace/module-a\\" one-app:5.0.0 /bin/sh -c \\"npm run serve-module '/opt/module-workspace/module-a' && node --inspect=127.0.0.1:9229 lib/server/index.js --root-module-name=frank-lloyd-root --module-map-url=https://example.com/module-map.json \\""`;
exports[`startApp applies inspect mode to node process when useDebug is passed 1`] = `"docker pull one-app:5.0.0 && docker run -t -p 3000:3000 -p 3001:3001 -p 3002:3002 -p 3005:3005 -p 9229:9229 -e NODE_ENV=development -v \\"/path/to/module-a:/opt/module-workspace/module-a\\" one-app:5.0.0 /bin/sh -c \\"npm run serve-module '/opt/module-workspace/module-a' && node --inspect=0.0.0.0:9229 lib/server/index.js --root-module-name=frank-lloyd-root --module-map-url=https://example.com/module-map.json \\""`;

exports[`startApp applies inspect mode to with custom port node process when useDebug and env var 1`] = `"docker pull one-app:5.0.0 && docker run -t -p 3000:3000 -p 3001:3001 -p 3002:3002 -p 3005:3005 -p 9221:9221 -e NODE_ENV=development -v \\"/path/to/module-a:/opt/module-workspace/module-a\\" one-app:5.0.0 /bin/sh -c \\"npm run serve-module '/opt/module-workspace/module-a' && node --inspect=127.0.0.1:9221 lib/server/index.js --root-module-name=frank-lloyd-root --module-map-url=https://example.com/module-map.json \\""`;
exports[`startApp applies inspect mode to with custom port node process when useDebug and env var 1`] = `"docker pull one-app:5.0.0 && docker run -t -p 3000:3000 -p 3001:3001 -p 3002:3002 -p 3005:3005 -p 9221:9221 -e NODE_ENV=development -v \\"/path/to/module-a:/opt/module-workspace/module-a\\" one-app:5.0.0 /bin/sh -c \\"npm run serve-module '/opt/module-workspace/module-a' && node --inspect=0.0.0.0:9221 lib/server/index.js --root-module-name=frank-lloyd-root --module-map-url=https://example.com/module-map.json \\""`;

exports[`startApp bypasses docker pull when the offline flag is passed 1`] = `" docker run -t -p 3000:3000 -p 3001:3001 -p 3002:3002 -p 3005:3005 -p 9229:9229 -e NODE_ENV=development -v \\"/path/to/module-a:/opt/module-workspace/module-a\\" one-app:5.0.0 /bin/sh -c \\"npm run serve-module '/opt/module-workspace/module-a' && node lib/server/index.js --root-module-name=frank-lloyd-root --module-map-url=https://example.com/module-map.json \\""`;

Expand Down
2 changes: 1 addition & 1 deletion packages/one-app-runner/src/startApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ module.exports = async function startApp({

const generateModuleMap = () => (moduleMapUrl ? `--module-map-url=${moduleMapUrl}` : '');

const generateDebug = (port) => (useDebug ? `--inspect=127.0.0.1:${port}` : '');
const generateDebug = (port) => (useDebug ? `--inspect=0.0.0.0:${port}` : '');

if (createDockerNetwork) {
if (!dockerNetworkToJoin) {
Expand Down

0 comments on commit 8443acc

Please sign in to comment.