
#!/bin/bash

bash <(curl -sSL https://get.docker.com)

systemctl enable docker --now

mkdir panel
cd panel

cat > compose.yaml << EOF
services:
  3xui:
    image: ghcr.io/mhsanaei/3x-ui:2.6.3
    container_name: 3xui_app
    # hostname: yourhostname <- optional
    volumes:
      - $PWD/db/:/etc/x-ui/
      - $PWD/cert/:/root/cert/
    environment:
      XRAY_VMESS_AEAD_FORCED: "false"
      XUI_ENABLE_FAIL2BAN: "true"
    tty: true
    network_mode: host
    restart: unless-stopped
EOF


docker compose up -d
