1

So i'm currently facing the problem, that I'm not able to talk to a specific port, which is outside of my docker setup. To be exact:

As you can see in the docker-compose.yml down below, i'm running nginx and php in my docker setup. I'm trying to work with a PHP framework right now, which needs to talk to a server on port 10011 which runs as a local server on my pc. In this case, it's an teamspeak-server, but this shouldn't make any difference to the topic itself.

When I try to connect to this server via my php docker container, I get an 111 - Connection refused error. When I run the exact same code via XAMPP, everything works just fine. So there seems to be something wrong with my docker setup.

My docker-compose file:

version: "3.2"
services:

  php:
    build:
      context: './.docker/php/'
      args:
        PHP_VERSION: ${PHP_VERSION}
    networks:
      - backend
    volumes:
      - ${PROJECT_ROOT}/:/var/www/html/
    container_name: php

  apache:
    build:
      context: './.docker/apache/'
    depends_on:
      - php
      - db
    networks:
      - frontend
      - backend
    ports:
      - "80:80"
    volumes:
      - ${PROJECT_ROOT}/:/var/www/html/
    container_name: apache

networks:
  frontend:
  backend:
volumes:
  data:

Note: All unrelated containers were removed for brevity.

How can I fix this? And what do I need to change, when the teamspeak server wouldn't run locally, but on a completely own server?

Thank you for reading.

Codekx
  • 11
  • 2
  • Is there a firewall running on the system you're trying to talk to? Is it on the local network, or over the Internet? You're getting an actual "connection refused", which means traffic is actually traversing the network, but is then actively receiving a rejection from something, so there is definitely something actively refusing the connection. Check the teamspeak server settings to make sure it doesn't have any allow/deny lists, and also again for any firewalls in between the systems. – tilleyc Apr 09 '21 at 13:56
  • Both teamspeak server and docker are running locally on my pc. I disabled my firewall and added the ip from the php docker container to the query_ip_allowlist (missed that before), but I still get an `Error 111: Connection refused`. Or is the ip from the php docker container just the wrong ip adress? – Codekx Apr 09 '21 at 16:29
  • I think there seems to be something wrong with docker, because even when the ts3 server is down, I get Connection refused. So it doesn't seem to come outside of docker.. – Codekx Apr 09 '21 at 17:34

0 Answers0