mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-11 07:32:57 +03:00
🚀 Feature: Docker containers of each component (backend & frontend) #402
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wargio on GitHub.
Feature description
It would be nice to have
pocket-id:latest-frontend&pocket-id:latest-backendfor more advance users.Pitch
Currently i'm running the frontend and the backend without caddy by overwriting the entrypoint.sh script (this is to avoid having 2 reverse proxy in chain). this is a bit hacky and having just two images for each component would be great.
@wargio commented on GitHub:
This is exactly what i do and i just disable caddy from running, since i don't need it.
and the
entrypoint.sh@kmendell commented on GitHub:
@wargio I think the way svelte works is it has to be compilied , so im not sure that would be possible, unless we would release that standalone image, will ahve to defer to stonith though...
@stonith404 commented on GitHub:
In my personal projects, I use separate images for the frontend and backend. However, for projects like this, I prefer a single image because it simplifies the installation process and reduces potential setup issues.
@wargio, couldn’t you just expose the backend and frontend ports directly from the container? Caddy would still run, but you’d be bypassing it.
I also agree with @kmendell’s opinion. For advanced users, building the image themselves likely wouldn’t be a problem.
@kmendell commented on GitHub:
Hi @wargio You can build the backend / frontend manually and use those or push your own docker image, I think the idea is to keep it simple for users, so for more advanced users I think that may be the approach we should take, @stonith404 do you agree?
If you follow the Standalone installation docs, that will get you the build steps required for what I'm describing above.
Though i do see what you are asking for and could see how it's useful as well.
@wargio commented on GitHub:
I think the best solution would be to have a static webui (kinda like you have when compile React) and serve it from Golang GIN framework, so we can avoid running node for some static files, so in this way you don't need caddy to reverse proxy anything and the users can avoid having 2 reverse proxies in chain for no reasons.
@wargio commented on GitHub:
there is no real performance difference. just cached resources vs live pages.
Absolutely. maybe we could modify the entrypoint to disable caddy via env variable, so advance users can setup their reverse proxy in whatever flavour they want.
@wargio commented on GitHub:
No. The entrypoint script needs to be replaced with one calling the needed binaries. So I either use two instances which calls the binaries directly via entrypoint/cmd or replace the script. Both requires to know the binary name, so if in the future this change it will break the deployment of some people. It's safer to just modify the entry point for everybody and support an environment variable which launches or not caddy.
@stonith404 commented on GitHub:
Exporting the frontend as static HTML and JS is technically possible but would require disabling server-side features currently in use. For instance, most pages rely on server-side rendering.
I think removing server side rendering might actually worsen the performance more than having two reverse proxies. @wargio, have you make any performance tests to determine if chaining two reverse proxies has a significant impact?
@kmendell commented on GitHub:
@wargio @stonith404 Would a acceptable solution to this be to create some documentation on how to build the containers? For these "advanced users" or should we leave it as is?
@kmendell commented on GitHub:
@wargio I think you can already do this by using the following in docker compose:
@stonith404 commented on GitHub:
In
v0.29.0Caddy can now be disabled withDISABLE_CADDY=true.