Slowly exploring the lemmy ecosystem, since I don’t want to use reddit, and was wondering if selfhosting would be a good idea?
Slowly exploring the lemmy ecosystem, since I don’t want to use reddit, and was wondering if selfhosting would be a good idea?
I see the container thing a little different. A container should contain all things that are needed to run the containered application (and if it is a web application then exposing one single port). Creating containers should not create multiple other containers ( have no other use for) or networks, or volumes.
They aren’t all one application. Many of the parts can be swapped out for alternatives, shared with other services, or just excluded entirely. They can also be scaled separately which is important because not all of them need to scale at the same rate.
What you want is explicitly what docker-compose exists to do.
Let’s go through it.
proxy: image: nginx:1-alpine
I already have one running, why do I now need another one installed als another container exclusively for Lemmy?pictrs: image: asonix/pictrs:0.4.0-beta.19
I have no other use for this except for Lemmy, why do I need another container just for this application I never heard of?postgres: image: postgres:15-alpine
I have absolutely no use for Postgres. Why do I need to install a database server as container just for being used by Lemmy, and Lemmy only?And then, yes, of course,
lemmy
andlemmy-ui
So 5 different containers (and 4 volumes, and 2 networks) all set up only for Lemmy, cluttering my setup – not counted in all the volumes, containers, and networks set up by the 3 additional containers.
And since I’m pinned to specific versions I need to manually check new/changed dependencies when updating Lemmy instead of just rebuilding the container.
I still see no point in that.
It is common to run more than one application in a given server. Nginx, for example, is widely used as a reverse proxy and web server for operating multiple containerized applications on the same server. Postgres is a commonly used database that can potentially be used on hundreds of applications simultaneously. Duplicating them on all containers would just create a mountain of problems and waste resources for no real benefit.
If all you’re running is lemmy then why are you so upset about containers “cluttering” up things? What is there to clutter up, your
docker ps
output ? If you want, just pretend the host is itself a container running lemmy (which it might just be, depending on your host!). Alternately, make your own nested container that just does adocker-compose up
and pointlessly duplicate all the services you want. Complaining that the container managers don’t do this for you, to the detriment of others who don’t share your specific niche, is just blatantly entitled and absurd.I use it as reverse proxy already. Why do I need to install a reverse proxy for Lemmy?
That’s the thing: i don’t.
But maybe I should get a real or virtual machine used exclusively for Lemmy and adding its Docker environment to my current Portainer installation.
You don’t. Configure the one you already have and just remove that entry from your docker-compose. This is exactly why they’re handled as separate containers.
And by “configuring” you mean nothing more than simply setting up the connection from example.com:443 to the machine and exposed port? That would at least solve 1 out of 5 issues I have … :)
Yeah, basically. Can’t really give more details without knowing your specific setup but you can look into the nginx container lemmy uses to see if there’s a config in there you can just copy over to your existing container. You may also need to make sure lemmy is using the same virtual network as your nginx container.
I have a strong feeling against manually messing with any upstream code (in the broadest sense containers are upstream code) so I’m totally not going to just “copy over” some configuration and potentially break my current setup.
I’m fine with forwarding a request on example.com:443 to whatever port in one of the Lemmy containers is needed.
I’ll likely look into this whole mess of a setup when I have time to spare for it. Maybe just deploying a (virtual) machine with Docker just for Lemmy is the cleanest way. As said: I have zero other use for any of the software needed by Lemmy …