---
version: "3"

services:
  3x-ui:
    build:
      context: .
      args:
        ANTIZAPRET: "1"
    container_name: 3x-ui
    hostname: 3x-ui
    networks:
      traefik:
    labels:
      - traefik.enable=true
      - traefik.http.routers.3x-ui.rule=Host(`<...>`)
      - traefik.http.routers.3x-ui.service=3x-ui
      - traefik.http.routers.3x-ui.entrypoints=https
      - traefik.http.services.3x-ui.loadbalancer.server.port=<...>
      #
      - traefik.http.routers.3x-ui-sub.rule=Host(`<...>`)
      - traefik.http.routers.3x-ui-sub.service=3x-ui-sub
      - traefik.http.routers.3x-ui-sub.entrypoints=https
      - traefik.http.services.3x-ui-sub.loadbalancer.server.port=<...>
      #
      - traefik.tcp.routers.vless.rule=HostSNI(`<...>`)
      - traefik.tcp.routers.vless.tls.passthrough=true
      - traefik.tcp.routers.vless.service=3x-ui-inbound-443
      - traefik.tcp.services.3x-ui-inbound-443.loadbalancer.server.port=443
    volumes:
      - $PWD/db/:/etc/x-ui/
      - $PWD/cert/:/root/cert/
    environment:
      PUID: 1000
      PGID: 1000
      XRAY_VMESS_AEAD_FORCED: "false"
      TZ: Europe/Moscow
      XUI_SERVER_IP: "" # Server IP
    tty: true
    restart: unless-stopped

networks:
  traefik:
    external: true