Jackett does not work with docker-compose

Hello everyone,

I have been trying to follow along this repo but I have been encountering a wall when it came to setting up Jackett.
My issue is fairly simple, I am trying to learn about docker and the jackett image works fine when I run a simple docker-run -d --name=jackett.

Unfortunately I am trying to package everything in one simple .yml file but when I do so I cannot connect to jackett anymore

The curl response when I try to reach either localhost;9117 or 127.0.0.1:9117 is

Failed to connect to 127.0.0.1 port 9117: Connection refused

I have looked up my proxy and it should not be an issue (I am working on macOS Catalina).

Thanks in advance for your help.

version: "3.7"
services:
  deluge:
    container_name: deluge
    image: linuxserver/deluge:latest
    restart: unless-stopped
    environment:
      - PUID=${PUID} # default user id, defined in .env
      - PGID=${PGID} # default group id, defined in .env
      - TZ=${TZ} # timezone, defined in .env
    volumes:
      - ${ROOT}/downloads:/downloads # downloads folder
      - ${ROOT}/config/deluge:/config # config files
  jackett:
    container_name: jackett
    image: linuxserver/jackett:latest
    restart: unless-stopped
    network_mode: host
    environment:
      - PUID=${PUID} # default user id, defined in .env
      - PGID=${PGID} # default group id, defined in .env
      - TZ=${TZ} # timezone, defined in .env
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${ROOT}/downloads/Torrents/Files:/Downloads # place where to put .torrent files for manual download
      - ${ROOT}/config/jackett:/config # config files
   ports:
     - 9117:9117

Those two are mutually exclusive:

or

Either the container hooks into the network namespace of the host (which in case of Docker Desktop always is a VM and not your host!), which as a result binds the container port to the host interface (Docker Desktop: of the vm) , or you run the container in a bridge or overlay network and publish ports. I am not even sure if network_mode: host even works on Docker Desktop. If it does, you need to use the ip of the docker vm and not the host ip or localhost.

If the jackett service really listens on port 9117, then most likely your container doesn’t. Check the container logs to see what causes the problem.

Please share the exact command, as this can not be right:

How else should we be able to compare whether your docker run (I assume it’s with the dash in between` matches your service definition in the compose file?

1 Like

It does, it is just not really useful usually

And the yaml is syntactically incorrect. The indentation of the ports section is wrong, but it could be just the result of wrong editing on the forum.