Any way to play with nginx conf values without rebuilding?

I’m already using higher values for worker_connections and worker_processes on nginx through replace rules in app.yml

Though I would play around to find the best values a bit ideally without rebuilding discourse every time. Is there a way to change nginx.conf in the container and restarting nginx process without rebuilding discourse all over?

Yes, you can go into the contain (e.g., ./launcher enter app) use apt to install an editor, edit the NGINX files and sv restart nginx (reload might work?).

2 Likes

That’s a way I thought about and tried until i saw that there isn’t even a single source for apt. Adding one myself kind of sounds a bit flaky for system I don’t know and runs in production. Having at least vi there would really help for some simple tasks wink, wink :wink:

I have never paid attention to the apt sources, but I have several templates that do an apt-get update; apt-get install to install stuff in the container (my dashboard.literatecomputing.com needs python and ansible, for example). It works, or did as recently as last Friday. Similarly, the template I use for doing migrations add vim and some other stuff.

I don’t recommend hand-editing stuff for production, as the changes will obviously go away at the next rebuild, but if what you want to do is just test values to find the ones that work, this is likely a good-enought solution (as it avoids a bunch of rebuilds).

Also 2-container setup typicall has <1 minute of downtime when you do a rebuild and start the new container.

I wouldn’t pay attention to apt sources as well but without sources there’s no install, otherwise I really wouldn’t care.

root@forum-app:/var/www/discourse# apt install vi
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package vi
root@forum-app:/var/www/discourse# apt list sources
Listing... Done
root@forum-app:/var/www/discourse#

it’s the same for apt-get and vim or nano - just to make sure :wink:

Did you run apt update before using apt install? The first time, you need to refresh the source list.

2 Likes

Ubuntu something and after apt update && apt dist-upgrade (where I answered no, because it wanted update pqsl and I paniced) apt install nano succeeded ok.