Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enable debugging #196

Merged
merged 1 commit into from
Jun 17, 2020
Merged

chore: enable debugging #196

merged 1 commit into from
Jun 17, 2020

Conversation

LoneRifle
Copy link
Contributor

@LoneRifle LoneRifle commented Jun 17, 2020

Debugging in Gitpod

Problem

To allow developers to quickly troubleshoot the codebase, configure
GoGovSG to run with debugging enabled, even when in a docker container.

Solution

[npm, docker]

  • replace nodemon and ts-node with ts-node-dev
  • expose port 9229 (Node.js debug) for app container in docker-compose
  • npm run server-dev listen for port 9229 on all interfaces, not just
    localhost, to facilitate debugging within a Docker container [1]

[docs]

  • rewrite the README to document ts-node-dev instead of nodemon

[gitpod]

  • ignore port 9229
  • add Theia launch config to attach a debugger to npm run docker-dev

[misc]

  • remove nodemon.json, no longer used
  • allow favicons to be served directly by webpack-dev-server

Notes
[1] - This is needed as Docker would treat its host as a separate
machine. This also means that debugging on bare-metal would allow
others to connect to the port remotely. Caution is hence advised when
choosing to debug GoGovSG on bare-metal

@LoneRifle LoneRifle force-pushed the debugging branch 2 times, most recently from f6a86c3 to f9ca9f9 Compare June 17, 2020 03:54
To allow developers to quickly troubleshoot the codebase, configure
GoGovSG to run with debugging enabled, even when in a docker container.

[npm, docker]
- replace nodemon and ts-node with ts-node-dev
- expose port 9229 (Node.js debug) for app container in docker-compose
- `npm run server-dev` listen for port 9229 on all interfaces, not just
  localhost, to facilitate debugging within a Docker container [1]

[docs]
- rewrite the README to document ts-node-dev instead of nodemon

[gitpod]
- ignore port 9229
- add Theia launch config to attach a debugger to `npm run docker-dev`

[misc]
- remove nodemon.json, no longer used
- allow favicons to be served directly by webpack-dev-server

Notes:
[1] - This is needed as Docker would treat its host as a separate
machine. This also means that debugging on bare-metal would allow
others to connect to the port remotely. Caution is hence advised when
choosing to debug GoGovSG on bare-metal
Copy link
Contributor

@liangyuanruo liangyuanruo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Could you share more on Theia?

@liangyuanruo liangyuanruo merged commit 252425e into develop Jun 17, 2020
@liangyuanruo liangyuanruo deleted the debugging branch June 17, 2020 09:19
@LoneRifle
Copy link
Contributor Author

@liangyuanruo it's basically the VSCode fork maintained by the Eclipse Foundation that Gitpod builds on top of

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants