Код IT Загрузка примера кода…

YAML main.yml
version: '3'
services:
  app1:
    image: your-app-image
    ports:
      - "8081:80"
  
  app2:
    image: your-app-image
    ports:
      - "8082:80"

  haproxy:
    image: haproxy:latest
    volumes:
      - ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
    ports:
      - "80:80"
    depends_on:
      - app1
      - app2
version: '3'
services:
  app1:
    image: your-app-image
    ports:
      - "8081:80"
  
  app2:
    image: your-app-image
    ports:
      - "8082:80"

  haproxy:
    image: haproxy:latest
    volumes:
      - ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
    ports:
      - "80:80"
    depends_on:
      - app1
      - app2