-
Notifications
You must be signed in to change notification settings - Fork 99
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
Add a devcontainer configuration #163
Open
oplik0
wants to merge
16
commits into
NodeBB:master
Choose a base branch
from
oplik0:devcontainer
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have added some basic documentation under |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a fairly useful tool for mainly GitHub Codespaces users (though it should also work with Docker Desktop and self-hosted remote hosts.
This specific configuration provides a NodeBB instance running in the background (using grunt to rebuild on changes) with the currently developed plugin linked to it and activated already.
Some issues:
yarn install
and setup, the actual build with bundling takes <10 seconds.potential solutions:
build.cacheFrom
- this would probably require publishing an image to use as cache, and to really help require moving NodeBB setup into docker so it is actually cached.updateContentCommand
which will also run when prebuilding. I think it should be possible to get ~30 second startup from a prebuilt codespace.config.json
has hardcoded localhost URL which may become a slight issue when for example sharing NodeBB port online (with Codespaces specifically) or just mapping it to a different port on host. Most things still work in these cases though and it's simple to change in the container (though here a better way to restart NodeBB would be useful), but it can break some things (for example SSO plugins). This seems like a fairly rare problem and I encountered it only once (with an SSO plugin as mentioned).This is IMO currently the biggest issue and I'm just not entirely sure how should I resolve it - I don't think this deserves a section in main README, but perhaps a separate README in the
.devcontainer
folder would be fine?There isn't much to explain, it mostly just works, but I think it might be a good idea to have a single place with basic information like credentials used or path to NodeBB.
I have tested it with Codespaces and some time ago also in Docker Desktop and it worked fine then (and my changes since shouldn't have affected anything there). I'm also using a very similar setup for a few plugins already. I find it to be quite nice dx to have a fresh instance for each plugin ready without having to do any further setup :)
I marked it as draft due to the documentation issue - please let me know where I should put something (or whether it's needed).