Omnibus docker setup? #287

Closed
opened 2025-11-09 09:45:01 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @endigma on GitHub (May 25, 2024).

I see in the self-hosting docs the recommended docker-compose setup has two containers both running the same image with a different port exposed, I don't understand why this isn't just a single image with a different path for API traffic?

This probably already works with something like traefik doing host based routing to the two different ports on the same container, but having this built in would simplify deployments a lot.

If there is a reason why you'd want to run two separate containers, what is it?

Originally created by @endigma on GitHub (May 25, 2024). I see in the [self-hosting docs](https://github.com/imputnet/cobalt/blob/current/docs/api.md) the recommended docker-compose setup has two containers both running the same image with a different port exposed, I don't understand why this isn't just a single image with a different path for API traffic? This _probably_ already works with something like traefik doing host based routing to the two different ports on the same container, but having this built in would simplify deployments a lot. If there is a reason why you'd want to run two separate containers, what is it?
GiteaMirror added the feature request label 2025-11-09 09:45:01 -06:00
Author
Owner

@dumbmoron commented on GitHub (May 25, 2024):

If there is a reason why you'd want to run two separate containers, what is it?

the reason for this is that cobalt has two modes: api and web (frontend) - it was split up, so if you want to run a "full" instance you need to run both of them.

the motivation behind that is so that you can run several api instances with only one web instance, and also that the "web"/frontend will eventually become a separately, statically built website that won't require a node.js runtime

@dumbmoron commented on GitHub (May 25, 2024): > If there is a reason why you'd want to run two separate containers, what is it? the reason for this is that cobalt has two modes: api and web (frontend) - it was split up, so if you want to run a "full" instance you need to run both of them. the motivation behind that is so that you can run several api instances with only one web instance, and also that the "web"/frontend will eventually become a separately, statically built website that won't require a node.js runtime
Author
Owner

@endigma commented on GitHub (May 28, 2024):

Ok, but serving web from all the API instances as well shouldn’t be any additional load over routing all the web traffic to one instance?

Adding routes to an express app doesn’t add any runtime overhead, its the same cpu load for n requests across any amount of servers

Scaling is easier without the arbitrary separation between web and api

@endigma commented on GitHub (May 28, 2024): Ok, but serving web from all the API instances as well shouldn’t be any additional load over routing all the web traffic to one instance? Adding routes to an express app doesn’t add any runtime overhead, its the same cpu load for n requests across any amount of servers Scaling is easier without the arbitrary separation between web and api
Author
Owner

@ihatespawn commented on GitHub (May 29, 2024):

not everyone wants to host the web version of cobalt. just look at the instance list, 1/3 of the instances have only the api. maybe some people want to make their own website for cobalt (probably not).

@ihatespawn commented on GitHub (May 29, 2024): not everyone wants to host the web version of cobalt. just look at the [instance list](https://instances.hyper.lol/), 1/3 of the instances have only the api. maybe some people want to make their own website for cobalt (probably not).
Author
Owner

@endigma commented on GitHub (May 30, 2024):

Then you can add a flag for that, its still not a reason you shouldn’t be able to run both halves at once

@endigma commented on GitHub (May 30, 2024): Then you can add a flag for that, its still not a reason you shouldn’t be able to run both halves at once
Author
Owner

@wukko commented on GitHub (May 30, 2024):

frontend will soon be completely separated & rewritten. this is why it's the way as it is right now.

@wukko commented on GitHub (May 30, 2024): frontend will soon be completely separated & rewritten. this is why it's the way as it is right now.
Author
Owner

@endigma commented on GitHub (May 30, 2024):

rewrite it in rust why don't you, that should fix everything

@endigma commented on GitHub (May 30, 2024): rewrite it in rust why don't you, that should fix everything
Author
Owner

@wukko commented on GitHub (May 31, 2024):

rewrite it in rust

frontend in rust? nuh uh

@wukko commented on GitHub (May 31, 2024): > rewrite it in rust frontend in rust? nuh uh
Sign in to join this conversation.