We've moved discussions to Discord

Github Codespaces working

Joshua L Handel
So for those that have github codespaces active in their account I have it working..

For those that haven't been following Codespaces are developer containers that allow you to dev from VS Code with no local configuration (some apps can even use web based VS Code)

One caveat, the app will run via the web VS Code instance but websockets don't work and there are some other issues.. but VS Code + Github codespaces extensions allows you to dev locally and the only thing running locally is VS Code..  Setup is all code based in the .devcontainer folder (I have included my version of those files here).

So far it makes deving from any machine super easy :-)

Hotwire-livereload doesn't work consistently, but turbo_streams seem fine. 

run in a console in vscode with bin/dev after the codespace has started up and connected.

I am also not sure what the create-db-user.sql is for but it was part of the sample rails+postgres that I started with. 

(FYI it is currently free for personal accounts too :-)..)

docker-compose.yml 1.55 KB
devcontainer.json 1.42 KB
create-db-user.sql 71 Bytes
Dockerfile 1.48 KB
Michael Reisner
Hi Joshua, great to hear about this topic. I'm about to embark on using web version of github codespaces to kickstart a RoR project with Jumpstart rails
1. I can't download the files you put: clicking on them does not trigger anything. Could you by any chance put them on a public gist?
2. did i understand correctly? if i use the pure web github codespace which i was about to, things like hotwire-livereload and websockets won't work. but if i download VScode and use githubspaces within VS code (as in https://visualstudio.microsoft.com/services/github-codespaces/#tab-493b451560917d776a0) then all work fine. 

Many thanks
Joshua L Handel
here you go: .devcontainer for jumpstartrails (github.com)

And yes, because of how web based VS Code works you can forward the app (port 3000) but it only supports http and https

If you want to have things routed "properly" you need vscode local as it then sets up ports from localhost to your verious codespace services.
Joshua L Handel
also for postgresql I am not using an external admin, I am using an extension in VS Code for that as that extension connects fine but I couldn't get an external admin to connect (admittedly I only tried that with web vs code so maybe I COULD get an external admin like pgadmin working with local vscode and how it handles port routing.)
Michael Reisner
thanks so much Joshua for the gist
Michael Reisner
For postgre I'm looking to do exactly that with pgamdin or tableplus. will let you know how it goes
Michael Reisner
Hi I'm running into an issue with the set up/files in your gist. Indeed if I add data (for example on of the first things to set up if you follow jumpstart Docs is and admin user) then it works, I can check this using like you the VS Code extension SQLTools. 
But everytime i rebuild the container (due to any change on dockerfile, devcontainer....), then all the data and for example, this 'admin user', disappears, the db is cleaned out...

Have you had this issue and how did you solve it if I may ask?

Many thanks

EDIT: just checked stackoverflow and it seems this issue is very close to this one
Notifications
You’re not receiving notifications from this thread.