mirror of
https://github.com/yusing/godoxy.git
synced 2026-01-14 07:33:36 +01:00
How to specify the API service address for the front end? Or are there other solutions? #38
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 @JoJenH on GitHub (Feb 7, 2025).
I deployed GoDoxy using Docker Compose. The provided Compose file uses the host network mode, but this makes GoDoxy unable to access containers using the default network. So I mapped the port of GoDoxy out, but found that the front end still attempts to access the API server on 127.0.0.1, which obviously does not have this service. How can I specify the API address for the front-end service?
Or are there other solutions?
@yusing commented on GitHub (Feb 7, 2025):
Hi, GoDoxy only works in host network mode (as of now). And it should be able to access all your docker networks without issue.
You can change listening address by editing the value of
GODOXY_API_ADDRin.env@JoJenH commented on GitHub (Feb 7, 2025):
Do you mean other network ports mapped to the host? Instead of using inter-container networking like Traefik without mapping?
And the address in env is listening address, not address for the front-end service.
@yusing commented on GitHub (Feb 7, 2025):
Yes. And not only ports that mapped to host, those not mapped to host will work because of this, e.g.
or
GoDoxy will connect to it via a docker IP (e.g. 172.16.0.12)
listening address is the address for frontend, since both are running in host network mode, and API should only listen on 127.0.0.1 (localhost)
@yusing commented on GitHub (Feb 7, 2025):
You have better use the default settings, do not try to run it in bridge mode or other network mode, it will not work.
@JoJenH commented on GitHub (Feb 7, 2025):
Can a container with host networkmode connect to a docker IP (e.g. 172.16.0.12)?
@yusing commented on GitHub (Feb 7, 2025):
Yes, unless you have manual iptables / ufw config (or running Docker in rootless mode? I haven't tested this case). You may want to try it yourself, GoDoxy is designed to be work like this (only GoDoxy's 80 and 443 exposed, keep all other apps private).
@JoJenH commented on GitHub (Feb 7, 2025):
Thank you. I'll try it myself. But I can't login now (in another issue).