-
Notifications
You must be signed in to change notification settings - Fork 92
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
Better way of avoiding port conflicts #32
Comments
I definitely prefer option 2 for performance reasons... why have multiple nginx layers when you only need one. |
Option 1. could/would be used with a single The important benefit of Option 1. is encapsulation. All services needed to run Lemmy are in that case encapsulated in and managed by Performance hit should be negligible. I've run infrastructures with 2 |
We have an internal repo that we use to deploy lemmy.ml and associated test instances, it also uses the method 2 you explain. Just specify the starting port for each instance, and other ports are immediately above it. I prefer to use native nginx, because that makes it much easier to run other services besides Lemmy (its so lightweight that there is little reason to use a whole server). Also system packages will be updated more frequently (especially in case of security vulnerabilities), eg using unattended-upgrades. If we use a Docker image for nginx, it has to be updated manually in this repo all the time. |
Makes sense.
That's a valid consideration. It also makes it easier to upgrade from the current set-up. Option 2. it is, then! |
So, as I might have the time to work on this a bit soon, question: how do you specify the port in that setup? I could come up with a scheme, but maybe there's no need to reinvent the wheel? |
Its like this:
|
@rysiekpl Did you find a solution to your problem? As we now have a vars.yml file per-domain. We'll look at setting up a new variable called Edit: The main reason I want to fix this is because it forces nginx to be reloaded every time we deploy, when it doesn't need to be. |
I have not, I have not had the time to dive into it. |
Continuing discussion from #3.
It would be good to have a better way of avoiding port conflicts when running multiple instances of
lemmy
. Current approach (randomizing ports on every deploy) has several downsides.Quick brainstorm about options here:
include
nginx
in thedocker-compose.yml
, allowing us toproxy_pass
directly to specific containers; name relevant containers using the{{domain}}
:lemmy-{{domain}}
,lemmy-ui-{{domain}}
,pictrs-{{domain}}
, etc. Host-installednginx
would be unnecessary, or if already present would only need to hit a single port: the one exposed by thenginx
container.Have some faith in the admins running instances, and make it possible to explicitly set ports per deployment, such that and admin deploying 3 different Lemmy instances would just explicitly define three sets of ports. A version of this would be to have a "starting port" configurable per instance, and each actual service port just offset by a well-defined value (say,
lemmy_port
would bestarting_port
;lemmy_ui_port
would bestarting_port
+ 1, etc).Option 1. is the cleanest, keeps all Lemmy deploys in a "package" within the
docker-compose.yml
, all managed from a singlelemmy-ansible
checkout with minimal side-effects on the host system. From a perspective of a sysadmin this might be the most preferable, and also is the most in-line with the "docker way of doing things" so to speak.The text was updated successfully, but these errors were encountered: