I'm running Calibre in docker on an ubuntu server, using docker-compose.yml to define the container. I maintain two libraries ("fiction" and "non-fiction"). The Web UI works great, however, I get an error when I try to start the content server from the "Connect/Share" button in the UI:
Code:
"Could not start the Content server. Error: No socket could be created -- (('172.20.0.6',8080): [Errno 98] Address already in use)"
Why would it try to bind to the same internal port that the Web UI is already using? Regardless, I configured the content server to use internal port 8083, not port 8080. Here is my yml:
Code:
calibre:
image: linuxserver/calibre
container_name: calibre
environment:
- PUID=1000
- PGID=1000
- CONTENT_SERVER_PORT=8083
volumes:
- /home/mitrian/docker/calibre:/config
- /home/mitrian/docker/calibre/fiction:/fiction
- /home/mitrian/docker/calibre/non-fiction:/non-fiction
ports:
- "8088:8080" # Calibre Web UI
- "8090:8083" # Content Server
restart: unless-stopped
I can resolve the problem by adding the following line to docker-compose.yml:
Code:
command: calibre-server --port=8083 /config/fiction # Start content server on 8083
This is nice because it starts ODPS automatically when the container loads. However, it is library specific, meaning, I have to specify in the command which library to start the server for. This is mostly acceptable, except that the button in the UI doesn't stop the content server, and if I want to start the content server for "non-fiction", I have to modify the yaml and restart the container, which is cumbersome, especially if I'm remote (which is most of the time).
I could create separate containers, one for each library, to resolve this, but I'd like to figure out how to get the service working as intended, if possible. And I'd prefer it all be self-contained in a single container, as I also use calibre-web-automation and plan to add plug-ins and I don't want to duplicate all of that.
I've tried putting the Web UI on port 8083 instead, and a variety of other port configurations, but I still always get the same exact error above. Even if I put neither service on 8080, it seems to try and bind OPDS to 8080. Is that expected behavior?
My question is how to get the Web UI button to work to start/stop the content server, based on whichever library I have active at the time. And why it seems to force using port 8080 when that's already in use by the Web UI, and I've configured OPDS to be otherwise.