-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
How to selfhost web app v10? #722
Comments
They answered me in Discord: You can't as of right now. You'd have to set your own instances (API) in this : https://cobalt.tools/settings/instances I personally stay on v7 for now, waiting (hopefully) to have someone create a docker-compose for the web facing interface. |
Web must be run manually right now, but it does exist in the web directory, it's just not containerized. |
who said that? you can host it as a static build (the same way we do). you can read everything you need to know in web's readme file: https://github.com/imputnet/cobalt/blob/main/web/README.md |
Not as a docker compose, I meant. |
it is also indeed better to use the main web app with your api instance: https://cobalt.tools/settings/instances we don't track anything and it's one less thing for you to take care of. |
i don't think we'll be providing a docker image for frontend for now. if that ever changes, i'll try to remember to let you know. |
I'm unsure why it was appropiate to go this route especially considering that this was provided before without issue. Would you consider a PR adding this back? |
hey, sure! if you would like to work on it, here is a general outline of how i'd envision for it to look:
|
The last two points should be straightforward to implement. The first point, however, could be tricky. It’s inconvenient to have to republish a self-built variant to another registry—especially if you're using Kubernetes or Docker Swarm. Keeping it up-to-date would also be a hassle, and it rules out tools like Watchtower unless you're hosting your own fork with changes. I'm unsure of the best approach here, but maybe providing an additional image variant alongside the static web server image or just going the node image route with a reverse proxy like NGINX in front of node could work better. If we do want to go with the static webserver route I might take inspiration from how Piped handles this in their frontend, but this wouldn't solve issues with environment variables other than |
one of the goals when rewriting the frontend was for it to be relatively small and simple to host from the server perspective (no processing required to serve frontend pages post-build), which unfortunately comes at the cost of runtime customizability (and i guess is also one of the reasons why there is no "official" dockerfile for it right now). but if we once again bundle the entirety of the node project with the image (node_modules for web is ~100 MB on my machine) we are basically back to square 1, so that's why i wouldn't really consider this option to be "right" (in comparison, the static build output is just under 30 MB, and also vite mentions in their documentation explicitly not to use
i don't think this would work here since cobalt also uses these envs to include/omit certain parts of components (like hiding text that is not relevant if plausible is not enabled). maybe one approach (that i'm not sure how feasible would be) would be to build the frontend at startup and then get rid of the whole build environment and just serve the static files, which isn't really ideal, but it would work i guess |
In case anyone needs a docker image right now, I've made a basic one here: https://github.com/ggtylerr/globe/blob/master/services/cobalt-template/Dockerfile Do note that the copy paths would need to be changed if you aren't using the repo. It's just a matter of changing two lines. It's probably not suitable for a PR but in case it's used as a base, I've addressed some of the points @dumbmoron made:
|
Yeah I've pretty much already made a local branch with the changes needed for the original requirements into the existing Dockerfile it's just that I'm still looking for a possible solution that would fit better with published images. I'm probably going to end up making a small pr that just adds this functionality which would require build-time args for plausible and turnstile but where u can still patch the domain without needing to make and host your image. I think people who have the need for that "advanced usage" might be less bothered by having to host their own image but people who simply want to self-host cobalt for themselves won't be affected much by the current state of the project with these changes. |
problem description
Information about selfhosting a web app has been removed from the manual.
https://github.com/imputnet/cobalt/blob/main/docs/run-an-instance.md
The old configuration now runs 2 instances of cobalt-api.
How to selfhost new version of web app?
your instance configuration
The text was updated successfully, but these errors were encountered: