1
0

docker-compose.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. services:
  2. 3xui:
  3. build:
  4. context: .
  5. dockerfile: ./Dockerfile
  6. container_name: 3xui_app
  7. # hostname: yourhostname <- optional
  8. # The bundled Fail2ban (XUI_ENABLE_FAIL2BAN below) enforces the IP limit
  9. # with iptables, which needs NET_ADMIN. Without these caps a ban is logged
  10. # and shown in fail2ban status but never actually applied. NET_RAW covers
  11. # ip6tables. If you disable Fail2ban, you can drop cap_add.
  12. cap_add:
  13. - NET_ADMIN
  14. - NET_RAW
  15. volumes:
  16. - $PWD/db/:/etc/x-ui/
  17. - $PWD/cert/:/root/cert/
  18. environment:
  19. XRAY_VMESS_AEAD_FORCED: "false"
  20. XUI_ENABLE_FAIL2BAN: "true"
  21. # XUI_INIT_WEB_BASE_PATH: "/"
  22. # To use PostgreSQL instead of the default SQLite, run:
  23. # docker compose --profile postgres up -d
  24. # and uncomment the two lines below.
  25. # XUI_DB_TYPE: "postgres"
  26. # XUI_DB_DSN: "postgres://xui:xui@postgres:5432/xui?sslmode=disable"
  27. tty: true
  28. ports:
  29. - "2053:2053"
  30. restart: unless-stopped
  31. postgres:
  32. image: postgres:16-alpine
  33. container_name: 3xui_postgres
  34. profiles: ["postgres"]
  35. environment:
  36. POSTGRES_USER: xui
  37. POSTGRES_PASSWORD: xui
  38. POSTGRES_DB: xui
  39. volumes:
  40. - $PWD/pgdata/:/var/lib/postgresql/data
  41. restart: unless-stopped