title: Connect Postgresql from Docker Swarm Container
body: <p>I have 5 microservices which I intend to deploy over docker swarm cluster consisting of 3 nodes.</p>
  <p>I also have a postgresql service running over one of the 3 servers(not dockerized but rather installed over the server) which I have. I did assign the network as &quot;host&quot; for all of the services but they simply refuse to start with no logs being generated.</p>
  <pre><code>version: '3.8'
  services:
  
    frontend-client:
      image: xxx:10
      container_name: frontend
      restart: on-failure
      deploy:
        mode: replicated
        replicas: 3
      networks:
        - &quot;host&quot;
      ports:
        - &quot;xxxx:3000&quot;
  
  networks:
    host:
      name: host
      external: true
  </code></pre>
  <p>I also did try to start a centos container from a server which does not have postgres installed and was able to ping as well as telnet the postgresql port as well using the Host network being assigned to it.</p>
  <p>Can someone please help me narrow down the issue or look at the possibility which I might be missing???</p>