Skip to content
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

Configure APP_URL #51

Closed
neezer opened this issue Jan 7, 2025 · 1 comment
Closed

Configure APP_URL #51

neezer opened this issue Jan 7, 2025 · 1 comment

Comments

@neezer
Copy link

neezer commented Jan 7, 2025

Using the pro setup, I have the main application mapped to a different port because port 3000 is taken by another application already. I do this in Docker Compose like so

services:
  meme_search_pro:
    ports:
      - 3112:3000

However, it appears that the text-to-image generator expects (via hard-code) to always find the main app at port 3000:

APP_URL = "http://host.docker.internal:3000/image_cores/"

This generates failed requests when trying to use the image to text functionality:

2025-01-07 20:29:54,879 - INFO - Job added to queue: image_core_id=9 image_path='software/proxy2.jpg'
2025-01-07 20:29:54,880 - DEBUG - Starting new HTTP connection (1): host.docker.internal:3000
2025-01-07 20:29:54,892 - DEBUG - Starting new HTTP connection (1): host.docker.internal:3000
2025-01-07 20:32:05,012 - ERROR - FAILURE: status_sender failed with exception HTTPConnectionPool(host='host.docker.internal', port=3000): Max retries exceeded with url: /image_cores/status_receiver (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f741499cfe0>, 'Connection to host.docker.internal timed out. (connect timeout=None)'))

(Nothing is listening on 3000--the other app I have on that port is stopped during this test).

Can this be changed to read from an environment variable instead of a hard-code?

@neonwatty
Copy link
Owner

Adding a .env file for custom port mappings is certianly doable! Would you like to submit a PR to get it started? Port specifications in a .env would need to be read by both the app and image-to-text containers.

As for your current setup - if you have stopped your other process running on 3000 then the port mapping

ports:
  - 3000:3000

in the compose file should work. Can you confirm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants