Skip to content

Update dev container#3

Open
Scotchester wants to merge 2 commits into
feature/appcontainerfrom
feature/devcontainer
Open

Update dev container#3
Scotchester wants to merge 2 commits into
feature/appcontainerfrom
feature/devcontainer

Conversation

@Scotchester

Copy link
Copy Markdown
Member

⚠️ base branch: feature/appcontainer ⚠️


PR 3 of ??

This PR updates the dev container config that we started with from template-devcontainer to:

  • Updates the dev container config to build from app container
  • Adds debugging/testing support in VS Code
  • Adds Python code quality tooling

Testing

If you've already successfully tested PR #2 (the bare app container), the application can now be run in the devcontainer. On this branch

  1. Rebuild and Reopen in Container
  2. Use F5 or the UI to initiate a debug session

You should see output in a new terminal indicating that the app is now running, and you should now be able to invoke it in your Slack test workspace! Try the /define command to confirm.

You can also now use the VS Code Testing pane to run the tests.

Other notes

  • I again borrowed heavily from how Benefits approached its dev container setup, though I didn't get as fancy with the pyproject.toml. Not sure if there's value in packaging this one up in the same way as Benefits?
  • This PR would be a good starting point for some of the things in chore(pre-commit): autoupdate hooks template-devcontainer#11

- Build from app container
- Add debugging/testing support in VS Code
- Add Python code quality tooling
@Scotchester Scotchester changed the title feat: Update dev container Update dev container Jun 3, 2026
Comment on lines +10 to +13
"postCreateCommand": [
"/bin/bash",
".devcontainer/postCreate.sh"
],

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this from postAttachCommand to postCreateCommand after stumbling into this old SO thread that Aidan Feldman had commented on a while ago. I can't recall what minor build issue led me there, but I got past it.

Anyway, a commenter suggested that postCreate would be better since it should only need to run once when the devcontainer is (re)built. This works fine for me, but I admittedly didn't look into it any further to see if there's a reason we wouldn't want to do it post-create.

Comment thread .pre-commit-config.yaml
rev: v0.48.0
hooks:
- id: markdownlint
language_version: system

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a trick needed to get this to install on Alpine (in addition to installing node and npm in the Dockerfile).

Comment thread compose.yml
Comment on lines +24 to 27
command: serve --dev-addr "0.0.0.0:8001"
ports:
- "8000"
- "8001"
volumes:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8001 matches what the Benefits does. I think switching to 8001 in template-devcontainer would be worthwhile, since 8000 is the default port for a lot of services that might be run for the primary purpose of your dev container.

Necessary to be able to commit from within it.
@Scotchester Scotchester marked this pull request as ready for review June 3, 2026 21:46
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.

1 participant