Discourse development through docker or other

AI-generated summary

In a support thread titled “Discourse development through docker or other,” Olle11 asks if there’s a faster way to edit plugins or settings in a Docker container without rebuilding it. merefield confirms that rebuilding is required when adding or removing plugins and suggests switching from PuTTY to Windows Terminal for a better experience. david recommends setting up a local or cloud development environment instead of modifying a production site, linking to a guide on developing Discourse using a dev container. pfaffman offers a workaround for quick edits inside the container—pulling plugin updates and restarting services—but cautions that this is not recommended for complex changes and may require additional steps like running migrations (bin/rails db:migrate) and recompiling assets. merefield points out that migrations won’t run automatically, and pfaffman humorously acknowledges the complexity, leaving asset handling as “an exercise to the reader.” Olle11 considers reverting to his old method to avoid breaking the site and asks about Windows Terminal vs. PuTTY. pfaffman reassures him that moving to a new server allows safe testing without risking the live site. merefield strongly endorses Windows Terminal for its modern features: tabs, themes, Unicode support, GPU acceleration, WSL integration, and seamless shell switching—making it far superior to PuTTY.

Hi,

Whenever I need to add a plugin or edit some setting in PuTTy docker I need to rebuild the container.

Is there a faster way to edit in Docker without having to rebuild?

Best regards
Olle

If you add or remove a plugin you must rebuild.

Btw consider dropping PuTTY in favour of Windows Terminal.

Developing plugins against a production site will be a very tedious process. I’d recommend you look at setting up a local (or cloud) development environment. We have a few guides over here:

It’s not really recommended, but you can do something like

cd /var/discourse
./launcher enter app
cd /var/www/discourse/plugins/your-plugin-path
git pull
sv restart unicorn

But unless you’re changing something pretty trivial you’ll want to set up a development environment as suggested.

But that’s not going to run any migrations?

I’m assuming that if he doesn’t know any more than he seems to that there aren’t going to be any migrations. :person_shrugging:

But, yeah, if it were you, then I would have said to also

bin/rails db:migrate

And then you’d say “but what about assets?”

And I’d say, “Yeah, you need to do that too. Exactly how is left as an exercise to the reader.”

Hmm maybe I should just do it like I use to so I don’t break the site,

Is Windows Terminal better to use than PuTTY?

Best regards
Olle

If you move to a new server, you’ll make no changes to the site until you know the new site works. It’s impossible to break the site.

Yes, it’s much more modern.

Windows Terminal offers multiple tabs, customizable themes, Unicode and UTF-8 support, GPU acceleration, and better integration with modern Windows features compared to PuTTY.

Windows Terminal integrates with Windows Subsystem for Linux (WSL), supports native shell profiles, and allows seamless switching between PowerShell, Command Prompt, and WSL environments within a single window.