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

Change devcontainer.json to forward used ports for the project #51588

Merged
merged 1 commit into from Apr 18, 2024

Conversation

duduribeiro
Copy link
Contributor

@duduribeiro duduribeiro commented Apr 17, 2024

Motivation / Background

Currently the generated devcontainer.json file does not forward the ports required for the project, so you need to manually change it in order to access the project when running via Devcontainer.

This PR adds the required projects for the project.

Detail

Changed the devcontainer class to include the ports needed for the project and then puts it on the forwardPorts attribute on devcontainer.json

Additional information

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • N/A CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

@rails-bot rails-bot bot added the railties label Apr 17, 2024
@rafaelfranca
Copy link
Member

This isn't required. I can working and get post forwarded automatically by vscode without those changes. Why isn't it working for you?

@duduribeiro
Copy link
Contributor Author

duduribeiro commented Apr 17, 2024

@rafaelfranca Vscode is not my main editor, so I use https://github.com/devcontainers/cli to start my devcontainer and then I connect to the container to edit my files there.

Also, when I use my VSCode I don't have an remote.autoForward ports enabled, so it does not work. I would say it would be better to have all explicitly forwarded ports in the devcontainer definition.

Also, other editors may not have auto forward feature. See that RubyMine's devcontainer does not have autoforward https://youtrack.jetbrains.com/issue/IDEA-324256

this is why I think it would be better to have the forwardPorts explicitly on the definition

@rafaelfranca rafaelfranca merged commit 35efaca into rails:main Apr 18, 2024
2 of 3 checks passed
@duduribeiro duduribeiro deleted the add-devcontainer-forward-ports branch April 18, 2024 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants