this post was submitted on 28 Dec 2023
17 points (90.5% liked)

Selfhosted

37924 readers
562 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

Simply put, I can't get Audiobookshelf to respond to any port other than 80. I'm using the following Docker Compose (spacing may be off because I suck at formatting posts):

version: "3.7"
services:
audiobookshelf:
image: ghcr.io/advplyr/audiobookshelf:latest
network_mode: "host"
ports:
- 13378:80
restart: unless-stopped
volumes:
- /media/Vault/ABS/audiobooks:/audiobooks
- /media/Vault/ABS/podcasts:/podcasts
- /media/Vault/ABS/config:/config
- /media/Vault/ABS/metadata:/metadata

The way I understand it, externally the host should answer on port 13378 and the container on port 80. Just for kicks, I've tried the following variations:

  • 13378:80
  • 80:13378
  • 13378:13378

I've even tried it without the version statement. Regardless of these, Audiobookshelf will only answer on port 80. All my other containers work fine and answer on the port I designate.

I do not have anything else listening on port 13378.

What am I doing wrong?

all 5 comments
sorted by: hot top controversial new old
[–] cybersandwich@lemmy.world 24 points 6 months ago (1 children)

You're using network_mode: "host" which makes the container use the host's networking directly. When you use host mode, the port mappings are ignored because the container doesn't have its own IP address, it's sharing the host's IP. Remove or change the network mode to see if that fixes it.

[–] OneShotLido@lemmy.world 3 points 6 months ago

Perfect. Thanks!

[–] morethanevil@lemmy.fedifriends.social 12 points 6 months ago (1 children)

Network mode host means it is in your real host network. Ports are then ignored.

Remove the line network mode host

[–] OneShotLido@lemmy.world 2 points 6 months ago

Excellent, my friend. Thanks!