pldubouilh / gossa

🎶 a fast and simple multimedia fileserver
MIT License
874 stars 73 forks source link

[HELP] docker-compose port #105

Closed jd-apprentice closed 5 months ago

jd-apprentice commented 6 months ago

Hi! I'm trying to run gossa on a docker container, pretty much default but since i'm runninng 2 instances of it i'm trying to expose each of them on a different port.

Which I'm having problems doing something like this ->

version: '3.8'

services:
  portfolio:
    image: pldubouilh/gossa
    mem_limit: 50m
    memswap_limit: 100m
    ports:
      - "3500:3500"
    volumes:
      - ./portfolio/data:/shared:ro
    command: ./gossa -ro -p 3500

This is indeed exposing the 3500

image

But inside the repository is listening to other port, first logs displays:

Listening on http://0.0.0.0:8001/

So if I want to use a reverse proxy I have to mannualy give the container ip something like: 172.18.0.1:8001 instead of localhost:

Im doing something wrong?

pldubouilh commented 5 months ago

Hey - so you have two options

As you can see, docker compose didn't accept your command to start the container - but you can fix the docker-compose file like this to operate on 3500 everywhere

version: '3.8'

services:
  portfolio:
    image: pldubouilh/gossa
    mem_limit: 50m
    memswap_limit: 100m
    ports:
      - 3500:3500
    volumes:
      - ./portfolio/data:/shared:ro
    entrypoint: ["/gossa", -h, "0.0.0.0", "-p", "3500", "/shared"]
$ curl 127.0.0.1:3500
[... gossa content]

Second option, is to use the port forwarding from your host (3500) to the container (8001) and let the docker image start without any further modification to the start command

version: '3.8'

services:
  portfolio:
    image: pldubouilh/gossa
    mem_limit: 50m
    memswap_limit: 100m
    ports:
      - 3500:8001
    volumes:
      - ./portfolio/data:/shared:ro
$ curl 127.0.0.1:3500
[... gossa content]

Hope this helps !