version: '3.3'

services:
  web_1:
    image: ax3i0m/nginx:1.13.8
    build: ./nginx
    networks:
      - app_net
    deploy:
      replicas: 2
      endpoint_mode: vip

  web_2:
    image: ax3i0m/nginx:1.13.8
    build: ./nginx
    networks:
      - app_net
    deploy:
      replicas: 2
      endpoint_mode: dnsrr

  web_public:
    image: ax3i0m/nginx:1.13.8
    build: ./nginx
    networks:
      - app_net
      - public
    ports:
      - target: 80
        published: 8080
        protocol: tcp
    deploy:
      endpoint_mode: vip

networks:
  app_net:
    driver: overlay
    internal: true
  public:
