# Developing Discourse using a Dev Container

**URL:** https://meta.discourse.org/t/developing-discourse-using-a-dev-container/336366
**Category:** Developer Guides
**Created:** [November 15, 2024, 4:44pm UTC](https://meta.discourse.org/t/developing-discourse-using-a-dev-container/336366 "2024-11-15T16:44:08Z")
**Posts on this page:** 1
**Showing post:** 11

<div class="post-metadata">

### Author: ![dfabulich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dfabulich/32/108716_2.png) [@dfabulich](https://meta.discourse.org/u/dfabulich)
#### Post date: [May 28, 2026, 5:36pm UTC](https://meta.discourse.org/t/developing-discourse-using-a-dev-container/336366/11 "2026-05-28T17:36:07Z")

</div>

Those non-VS Code instructions didn’t work for me just now on macOS. **I recommend that macOS users who want to interact with the Discourse Docker image outside of VS Code use the legacy [`boot_dev`](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009) Docker script instead.**

With `docker ps` I found my container name (a randomized silly name, like `peaceful_lumiere`). I ran `docker inspect peaceful_lumiere | jq '.[0].NetworkSettings.Networks.bridge.IPAddress'` and it spit out an IP address. I went to `http://<ip>:4200` in my browser, and it just sat there spinning forever.

I think that’s because the `ember-cli` dev server isn’t listening on all interfaces; it’s only listening on `http://127.0.0.1:4200` inside the container.

I eventually got it to work by adding a `runArgs` section to `.devcontainer/devcontainer.json`, like this.

```diff
     8025, // mailhog
     9229 // chrome remote debug
   ],
+ "runArgs": [
+ "-p",
+ "127.0.0.1:4200:4200",
+ "-p",
+ "127.0.0.1:3000:3000",
+ "-p",
+ "127.0.0.1:9292:9292",
+ "-p",
+ "127.0.0.1:8025:8025",
+ "-p",
+ "127.0.0.1:9229:9229"
+ ],
   "remoteUser": "discourse",
   "remoteEnv": {
     "RAILS_DEVELOPMENT_HOSTS": ".app.github.dev",

```

… but if you do that, it _won’t_ work in VS Code (because VS Code _and_ the devcontainer will both try to forward ports). I made a separate `devcontainer-cli.json` and used `devcontainer --override-config .devcontainer/devcontainer-cli.json`, and that worked.

But then it dawned on me: I’ve jumped through all these hoops, but I’m no better off than using the existing legacy [`boot_dev`](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009) script. Following those documented steps is quicker and easier than trying to coerce `devcontainer` to do the right thing from the CLI.

Dev Containers are primarily intended for use in VS Code, or _something_ that will automatically manage port forwarding for you; `devcontainer` CLI doesn’t do that. So, if you don’t want VS Code, maybe don’t bother with Dev Containers.

---

_[View the full topic](https://meta.discourse.org/t/developing-discourse-using-a-dev-container/336366)._
