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: ad .devcontainer file e.g. for GitHub Codespaces #1136
Conversation
So these are the composer development dependencies, I'd guess, pulled in from phpunit: Lines 36 to 38 in 771d7a3
The recommended way of running composer to generate optimized autoloader can be seen here in our Makefile: Lines 11 to 12 in 771d7a3
I would not want to commit these into the repo (tough I'm glad they didn't also include the suggestions, the cloud SDKs are huge). We could:
|
Note we can also configure the GitHub dev-container here: https://github.com/PrivateBin/PrivateBin/new/master?dev_container_template=1&filename=.devcontainer%2Fdevcontainer.json Maybe we can tell it to run the command as wanted? |
Ok, that is something I can investigate over the weekend. How we solved this in our unit testing container and I do on my dev envs is that I install the dev-dependencies (phpunit) via:
This installs it into Hm, we may just be able to use our unit testing container image, it also has mocha pre-installed for driving the JS tests. |
I would bet mocha is preinstalled there too, that mixrooaft image has like lots of stuff preinstalled haha. And apparently some clever init scripts. But yeah feel free to fiddle around… |
If we can't turn off those init scripts and phpunit is not preinstalled we will likely have to substitute the image. |
FYI: I have not forgotten about this, but not yet figured out how to prevent it from running composer or how that composer run is triggered. I reviewed the default php configuration and it's Dockerfile - the container image simply has a number of tools including git, apache, npm and composer preinstalled, but I didn't spot what commands get executed in it or how that can be controlled. |
Indeed strange – could not find anything either… Though, unrelated, but that sounds inter)esting for having www directly serve files (not looked deeply into it). |
Whereever it comes form I have setup codespaces similarly for a Python project and it was quite cool: chaos-jetzt/website_pelican#38 You can configure it with a JSON and more JSONs can configure VSCode then. See https://containers.dev/ for the |
BTW https://devpod.sh/ is another toll for running that locally or with some other cloud providers. |
BTW the thing why it did not work is that it uses a generic image/universal one by default. Switched to the PHP one now. After alll we could also use our own but it is based on alpine so much stuff may not be compatible hmm… Also we'd want tight integration into VSCode there… Anyway, got it work basically, PrivateBin even starts by default and you can open it. And AFAIK the files are not created anymore, are they? However:
The cool thing is how easy you can debug it. Just create a PHP file with |
For GitHub Codespaces e.g.
077943a
to
664a8ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've rebased the branch to remove the original commit with all those files and the revert, to prevent these blobs becoming part of the git history.
I'll re-test it as well over the weekend and try looking into your listed points as well. My initial comment to some of these:
|
This PR may fix #1135
Fixes #1135 ?
Changes
ToDo