How to name/alias a network in Docker swarm Stack -
i give alias network in docker-swarm stack file.
currently, stack file looks
version: '3' networks: mybridge: services: web: restart: build: ./web image: shivanand3939/web expose: - "8000" volumes: - ./output:/usr/src/app/static command: /usr/local/bin/gunicorn -w 2 -b :8000 --access-logfile - classifierv2restendpoint_ridge_nb:create_app() networks: mybridge: aliases: - web deploy: replicas: 2 update_config: parallelism: 2 delay: 10s restart_policy: condition: on-failure nginx: restart: build: ./nginx/ image: shivanand3939/nginx ports: - "80:80" volumes: - /www/static networks: - mybridge deploy: replicas: 1 update_config: parallelism: 2 delay: 10s restart_policy: condition: on-failure viz: image: dockersamples/visualizer ports: - 8080:8080/tcp volumes: - /var/run/docker.sock:/var/run/docker.sock deploy: placement: constraints: [node.role == manager] when run file
docker stack deploy -c docker-stack.yml classifierbot i following output
creating network classifierbot_default creating network classifierbot_mybridge creating service classifierbot_viz creating service classifierbot_web creating service classifierbot_nginx the network name changed classifierbot_mybridge mybridge. 2 services nginx , web not able communicate among themselves.
so, question how can give alias network can referred mybridge
edit:
one way add
networks: mybridge: external: name: mybridge and create mybridge outside stack file defeats purpose right? unable in single stack file
Comments
Post a Comment