Multiple docker instances on the same host share the same connection

I run more than one ignition container on the same host, binding the ports 8088 and 8043 to different couples for each instance and it’s really cool, because in a while I can set up the gateway and work with several designers at the same time.

Actually I’m not a docker expert and probably I miss or I misunderstand some networking concepts, but I cannot manage to isolate the gateway page for those instances: after I logged into the page localhost:80xx I log into the page localhost:80yy, then I go back to localhost:80xx and I have to login again, and so on, back and forth I have to log in any time i browse a different gateway page

This is the docker-compose.yml:

services:
  gateway:
    container_name: "Ignition8087"
    image: kcollins/ignition:7.9.14  
    ports:
      - 8087:8088
      - 8042:8043
    networks: 
      - net_Ignition87
    stop_grace_period: 30s
    volumes:
      - .\gateway_backup.gwbk:/restore.gwbk
      - data8087:/var/lib/ignition
      - .\log:/var/log/ignition
    environment:
      GATEWAY_SYSTEM_NAME: "Ignition@8087"
      GATEWAY_ADMIN_PASSWORD: password
      GATEWAY_NETWORK_AUTOACCEPT_DELAY: 120  

volumes:
  data8087:
    external: True

networks: 
  net_Ignition87:
    driver: bridge```

Thank you for your help

More on this behavior here:

It's a function of the webserver not isolating the session authentication cookies per host:ip - only per host. There's a workaround mentioned there, but I wouldn't necessarily recommend it unless you really know what you're doing.
If you're developing entirely on the local machine, there should be internal IPs for each container that are unique - something like 172.17.0.X. You can access whatever port on that internal IP, regardless of what the container is set to expose.

1 Like

Thank you PGriffith!
Your suggestion led me to a very easy solution (tested and working :grin:)
I edited my hosts file and added the following lines:

127.0.0.1 ignition.87
127.0.0.1 ignition.90

Now I can log in to http://ignition.87:8087/ and to http://ignition.89:8089/ at the same time without interference.
All I needed is a pool of hostnames pointing at my local IP

Thank you again :+1: :vulcan_salute: