How to specify the API service address for the front end? Or are there other solutions? #38

Closed
opened 2025-12-29 09:21:55 +01:00 by adam · 7 comments
Owner

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?

Image

Image

Or are there other solutions?

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? ![Image](https://github.com/user-attachments/assets/5788a37e-c9a3-497b-9f2b-45852cd77c33) ![Image](https://github.com/user-attachments/assets/16e03664-8c26-4caa-86a7-e9b348bb182b) Or are there other solutions?
adam closed this issue 2025-12-29 09:21:55 +01:00
Author
Owner

@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_ADDR in .env

@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_ADDR` in `.env`
Author
Owner

@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.

@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.
Author
Owner

@yusing 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?

Yes. And not only ports that mapped to host, those not mapped to host will work because of this, e.g.

services:
  app:
    expose:
      - 3000

or

FROM ...
...
EXPOSE 3000

GoDoxy will connect to it via a docker IP (e.g. 172.16.0.12)

And the address in env is listening address, not address for the front-end service.

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): > Do you mean other network ports mapped to the host? Instead of using inter-container networking like Traefik without mapping? Yes. And not only ports that mapped to host, those not mapped to host will work because of this, e.g. ```yaml services: app: expose: - 3000 ``` or ```dockerfile FROM ... ... EXPOSE 3000 ``` GoDoxy will connect to it via a docker IP (e.g. 172.16.0.12) > And the address in env is listening address, not address for the front-end service. 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)
Author
Owner

@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.

@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.
Author
Owner

@JoJenH commented on GitHub (Feb 7, 2025):

Can a container with host networkmode connect to a docker IP (e.g. 172.16.0.12)?

@JoJenH commented on GitHub (Feb 7, 2025): Can a container with host networkmode connect to a docker IP (e.g. 172.16.0.12)?
Author
Owner

@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).

@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).
Author
Owner

@JoJenH commented on GitHub (Feb 7, 2025):

Thank you. I'll try it myself. But I can't login now (in another issue).

@JoJenH commented on GitHub (Feb 7, 2025): Thank you. I'll try it myself. But I can't login now (in another issue).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/godoxy#38