Dev Container config for development of MusicCPR to support simpler onboarding either via (remote) GitHub Codespaces or (local) docker container (unless it ends up too expensive or too slow).
- ensure that you have correctly named forks of both the frontend repository and the backend repositories in ("owned by") THIS github organization (
Lab-Lab-Lab
):- frontend
- so you should have a repo at almost EXACTLY this url
https://github.com/Lab-Lab-Lab/CPR-Music-YOURUSERNAME
- for example mine is
https://github.com/Lab-Lab-Lab/CPR-Music-hcientist
- for example mine is
- so you should have a repo at almost EXACTLY this url
- backend
- so you should have a repo at almost EXACTLY this url
https://github.com/Lab-Lab-Lab/CPR-Music-Backend-YOURUSERNAME
- for example mine is
https://github.com/Lab-Lab-Lab/CPR-Music-Backend-hcientist
- for example mine is
- so you should have a repo at almost EXACTLY this url
- frontend
- click the green "Use this template" button on this repository to create a new repository for your own development on this project, but create it also in this organization (
Lab-Lab-Lab
) so that you'll have $free access to the codespace- in the dropdown for the
Owner
, chooseLab-Lab-Lab
- you will need to name it something different than just
cpr-dev
, i suggest just adding a suffix to the repo name, e.g.cpr-dev-hcientist
. - probably make the repository
public
- in the dropdown for the
- in the resulting repo, you need to replace
Lab-Lab-Lab/CPR-Music
Lab-Lab-Lab/CPR-Music-Backend
and with your github repo names in the following files:.devcontainer/devcontainer.json
scripts/setup.sh
- commit those changes to your
cpr-dev-YOURUSERNAME
reopsitory. - On your computer, install the GitHub CLI if you haven't already.
- On your computer, install Docker if you haven't already.
- click the green
Code
button on yourcpr-dev
repository - select the
Codespaces
tab in the resulting popover - If you already have a codespace, click on it to launch it.
- Else, if you have no codespace for this repo, click the green
Create codespace on main
button
- using its HTTPS url clone your
cpr-dev-USERNAME
repository to your local machine - press the do everything hotkey Ctrl+Shift+P (or on macOS command+shift+P), type
reopen
, and then selectDev Containers: Reopen in Container
I'm unsure what info will help do this well, but here's where i'm looking first:
- CS 159 S24 Codespace demo I threw together
- vscode's doc about "remote python development" (they made it for flask, which isn't what we're doing, but it shows port forwarding which we will probably need)
- some person's django dev codespace
- someone's codespace for django with postgres
- possible example?
- should we setup backend that's deployed somewhere (e.g. dev.musiccpr.org or similar) to accept requests from frontend running locally and/or in codespace?
- in which case should we start by creating only a codespace/devcontainer for frontend?
- it seems like maybe sqlite supports everything we need for local, so should we revert to suggesting student devs/newbs/everyone use sqlite in local?
- to do in-browser development in a codespace, we need to have the cpr-dev, frontend, and backend repos all forked (well, i guess cpr-dev isn't exactly a "fork") within Lab-Lab-Lab, for EACH developer...
- in-browser sucks on a bad connection...