0

I am new to Docker swarm and therefore unsure what to do.

I am trying to create a drupal site and a DB using stack in Swarm.

My configuration consists of 3 VMs (using Virtual Box) which are connected to the bridged network adapter and are on the same subnet as the host (10.0.0.X).

Once I have deployed the app there were no errors, however I was not able to access the site from the host.

I have also verified connectivity between all nodes on the following ports

7946/tcp, 7946/udp, and 4789/udp

What am I missing? This is the compose file I am using:

version: '3.1'

services:

  drupal:
    container_name: drupal
    image: drupal:8.2
    ports:
      - "8080:80"    
    networks: 
      - drupal_net
    volumes:
      - drupal-modules:/var/www/html/modules
      - drupal-profiles:/var/www/html/profiles       
      - drupal-sites:/var/www/html/sites      
      - drupal-themes:/var/www/html/themes
 
  postgres:
    networks: 
      - drupal_net
    container_name: postgres
    image: postgres:9.6
    secrets:
      - psql-password
    environment:
      - POSTGRES_PASSWORD_FILE=/run/secrets/psql-password
    volumes:
      - drupal-data:/var/lib/postgresql/data
networks: 
  drupal_net:
    driver: overlay

volumes:
  drupal-data:
  drupal-modules:
  drupal-profiles:
  drupal-sites:
  drupal-themes:

secrets:
  psql-password:
    external:
      name: psql-pw

Notes:

  1. I have tried to add the host machine to the Swarm and was able to access the app only via localhost. If I were to enter one of nodes IP address, I still received no response.

  2. From another device on the same network, the app was still inaccessible. (I was able to ping all nodes including the host)

  3. I have tried to create to a single node Swarm and still there was no access to the app

  4. All of the scenarios mentioned I have tested with a simple nginx app as well

ido809
  • 1
  • 2
  • What is your machine OS? and did you check if you have a firewall which block all traffic coming to your machine? – ROOT Jan 18 '20 at 19:38
  • My OS is Linux Mint 19.1 MATE. I have tried to disable the firewall but there was still no access to the app – ido809 Jan 18 '20 at 19:49
  • this might help: https://superuser.com/questions/901422/virtualbox-command-line-setting-up-port-forwarding its to allow VirtualBox VMs port forwarding. – ROOT Jan 18 '20 at 20:01
  • But I am using the bridged network – ido809 Jan 18 '20 at 21:39

0 Answers0