Hi Docker Community,
So I’m networking three containers on the same overlay network and I’m having issues with communication between the containers. I’m currently running docker swarm and setting up a swarm with 3 containers. I’m linking a rasa server to a chatbot container and using an ngrok container because we need to expose the chatbot to a service for testing. I’m doing this through a docker compose file.
I’m new to docker and docker swarm so I don’t know if I’m properly linking the three properly and I could use some help with understanding overlay networking better and also how overlay networking functions when you need to expose services in the overlay network outside of the network.
I have included my Docker compose
version: '3.5'
services:
rasa:
image: rasa/rasa:2.8.9-full
container_name: rasa
ports:
- "5005:5005"
volumes:
- "./models:/home/ubuntu/datascience/chatops/opsdroid_deployment/models"
- ./rasa_endpoint.yml:/home/ubuntu/datascience/chatops/opsdroid_deployment/rasa_endpoint.yml
expose:
- "5005"
networks:
- opsdroid
command: >
run
--enable-api
-m /home/ubuntu/datascience/chatops/opsdroid_deployment/models/slate_faq_model_v5.tar.gz
--endpoints /home/ubuntu/datascience/chatops/opsdroid_deployment/rasa_endpoint.yml
-t rasa_secret_token -vv
restart: always
opsdroid:
image: technolutions/opsdroid-image:dev_v3
env_file:
- /home/ubuntu/datascience/chatops/opsdroid_deployment/opsdroid_secrets.env
depends_on:
- rasa
links:
- rasa
networks:
- opsdroid
ports:
- target: 8080
published: 8080
protocol: tcp
expose:
- "8080"
volumes:
- opsdroid:/root/.config/opsdroid:ro
- "/home/ubuntu/datascience/chatops/opsdroid_deployment/skills/__init__.py:/skills/__init__.py:ro"
- "/home/ubuntu/datascience/chatops/opsdroid_deployment/sec/opsdroid-cert.pem:/sec/opsdroid-cert.pem:ro"
- "/home/ubuntu/datascience/chatops/opsdroid_deployment/sec/opsdroid-private-key.pem:/sec/opsdroid-private-key.pem:ro"
- "/home/ubuntu/datascience/chatops/opsdroid_deployment/config/configuration.yaml:/configurations/configuration.yaml:ro"
configs:
- source: opsdroid_conf
target: /root/.config/opsdroid/configuration.yaml
command: >
start
-f /configurations/configuration.yaml
deploy:
restart_policy:
condition: any
delay: 10s
window: 60s
ngrok:
image: wernight/ngrok:latest
env_file:
- /home/ubuntu/datascience/chatops/opsdroid_deployment/opsdroid_secrets.env
ports:
- target: 4040
published: 4040
protocol: tcp
expose:
- "4040"
environment:
NGROK_PROTOCOL: http
NGROK_PORT: opsdroid:8080
NGROK_AUTH: ${NGROK_AUTH}
NGROK_USERNAME: ${NGROK_USER}
NGROK_HOSTNAME: ${NGROK_HOSTNAME}
NGROK_REGION: us
depends_on:
- opsdroid
links:
- opsdroid
networks:
- opsdroid
networks:
opsdroid:
driver: overlay
attachable: true
configs:
opsdroid_conf:
file: /home/ubuntu/datascience/chatops/opsdroid_deployment/config/configuration.yaml
volumes:
opsdroid: