TheWicklowWolf / BookBounty

Retrieve missing Readarr books from Library Genesis.
Mozilla Public License 2.0
64 stars 0 forks source link

Request - Option to Set Port in Docker Config #5

Closed mistersoup3 closed 1 month ago

mistersoup3 commented 1 month ago

As the title says -- the default port overlaps with eBookBuddy, so I can only have one at a time with my current configuration (everything on the same network, behind a vpn container).

If there is a way in the app configuration or as an environment variable to update the port, that would be very helpful.

TheWicklowWolf commented 1 month ago

In your docker-compose.yml you can simply specify a different port mapping, like this:

    ports:
      - 6868:5000
mistersoup3 commented 1 month ago

That doesn't work for my use case -- I am not opening up the ports like this. Because of the way the networks work for docker, both containers are essentially on the same localhost, so both cannot use the same port. They interfere, so whichever starts first gets port 5000 and the other is unable to bind to it. If there were a way to update the port run by the service, I can run them side by side here.

mistersoup3 commented 1 month ago

Example docker compose:

 bookbounty:
    depends_on:
      vpn:
        condition: service_healthy
    network_mode: 'service:vpn'
    image: thewicklowwolf/bookbounty:latest
    container_name: bookbounty
    environment:
      - selected_path_type=folder
      - library_scan_on_completion=True
    volumes:
      - ${DFLT_CONFIG}/bookbounty/config:/bookbounty/config
      - ${DFLT_MEDIA_SRC}/books:/bookbounty/downloads
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped

ebookbuddy:
    depends_on:
      vpn:
        condition: service_healthy
    network_mode: 'service:vpn'
    image: thewicklowwolf/ebookbuddy:latest
    container_name: ebookbuddy
    volumes:
      - ${DFLT_CONFIG}/ebookbuddy/config:/ebookbuddy/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
TheWicklowWolf commented 1 month ago

Not too familiar with that setup. But I think your best bet is to give one of those containers a different IP address on that network, which should remove the port conflict. Otherwise you can just fork the repo and adjust it to suit.

Best of luck with it

TheWicklowWolf commented 4 weeks ago

@mistersoup3 See https://github.com/TheWicklowWolf/Lidify/issues/3#issuecomment-2187351431

Download and modify gunicorn_config.py with the correct local port you want, mount it as a .. file !

it does the job :)

    volumes:
      - /local_path/gunicorn_config.py:/lidify/gunicorn_config.py