Skip to content

Add dev container setup #1280

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

Merged
merged 3 commits into from
Aug 28, 2024
Merged

Add dev container setup #1280

merged 3 commits into from
Aug 28, 2024

Conversation

StevenMaude
Copy link
Contributor

@StevenMaude StevenMaude commented Jul 19, 2023

Fixes #1047.

This allows someone to work on the docs via Codespaces or in VSCode using the dev containers feature.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jul 19, 2023

Deploying opensafely-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 121c0ca
Status: ✅  Deploy successful!
Preview URL: https://5580641e.opensafely-docs.pages.dev
Branch Preview URL: https://steve-devcontainer.opensafely-docs.pages.dev

View logs

@StevenMaude
Copy link
Contributor Author

StevenMaude commented Aug 2, 2023

Old discussion; either something with my browser, computer or Codespaces changed, because this problem's now gone.

This configuration works as is in a local dev container, and makes the port accessible. I'm having real trouble trying to get Codespaces to make the port available. You can curl localhost:8910 and get the response from the MkDocs server, so the server is running.

There is this discussion: https://github.com/orgs/community/discussions/61154 which might be related. I'm not sure.

I'm similarly having problems even in Codespaces from repositories that I know full well used to work like the research-template and running opensafely jupyter.

There's also mention of an new and forthcoming port forwarding mechanism: https://github.com/orgs/community/discussions/57596

So maybe return to this in a few weeks and try again. I'd prefer to having it working in Codespaces, and be able to validate that myself, before merging.

@StevenMaude
Copy link
Contributor Author

StevenMaude commented Apr 18, 2024

I should try this again, as I'd had similar problems with the team manual, and that just worked when I tried it with Codespaces more recently.

It works fine now.

For editing the site using a dev container locally, or in Codespaces
online.

The `deadsnakes` configuration is taken from the
`research-template-docker` repository:

https://github.com/opensafely-core/research-template-docker/blob/669a76d79c198925d788dedc34fe3c5a831872b5/Dockerfile#L20-L21

which avoids installing `software-properties-common` first (to get the
`add-apt-repository` command.

The dev container settings are based on the Bennett site configuration,
with a longer autosave delay, because the site currently takes a while
to build (#1397). Arguably, the save delay could be longer still.

No Markdown plugins are installed yet; maybe that's something we could
do in future.
This occurs when attempting to use `just run`.
This is minimally documented for now.

We could add more comprehensive guidance on editing content using
Codespaces in future.
@tomodwyer tomodwyer merged commit 4342abc into main Aug 28, 2024
2 checks passed
@tomodwyer tomodwyer deleted the steve/devcontainer branch August 28, 2024 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trial and document the use of Codespaces to work on this repository
2 participants