1
0

docker-compose.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. services:
  2. 3xui:
  3. build:
  4. context: .
  5. dockerfile: ./Dockerfile
  6. container_name: 3xui_app
  7. # hostname: yourhostname <- optional
  8. # Optional hard memory cap. When set, the panel auto-derives its Go soft
  9. # limit (GOMEMLIMIT, ~90%) from this so it GCs before the OOM killer fires.
  10. # mem_limit: 512m
  11. # The bundled Fail2ban (XUI_ENABLE_FAIL2BAN below) enforces the IP limit
  12. # with iptables, which needs NET_ADMIN. Without these caps a ban is logged
  13. # and shown in fail2ban status but never actually applied. NET_RAW covers
  14. # ip6tables. If you disable Fail2ban, you can drop cap_add.
  15. cap_add:
  16. - NET_ADMIN
  17. - NET_RAW
  18. volumes:
  19. - $PWD/db/:/etc/x-ui/
  20. - $PWD/cert/:/root/cert/
  21. environment:
  22. XRAY_VMESS_AEAD_FORCED: "false"
  23. XUI_ENABLE_FAIL2BAN: "true"
  24. # Go memory soft limit. If neither is set, the panel auto-detects the
  25. # cgroup/host limit and targets ~90%. Pin it explicitly with one of:
  26. # XUI_MEMORY_LIMIT: "400" # in MiB
  27. # GOMEMLIMIT: "400MiB" # Go syntax, takes precedence
  28. # XUI_PPROF: "true" # expose pprof on 127.0.0.1:6060 for profiling
  29. # XUI_INIT_WEB_BASE_PATH: "/"
  30. # XUI_PORT: "8080"
  31. # To use PostgreSQL instead of the default SQLite, run:
  32. # docker compose --profile postgres up -d
  33. # and uncomment the two lines below.
  34. # XUI_DB_TYPE: "postgres"
  35. # XUI_DB_DSN: "postgres://xui:xui@postgres:5432/xui?sslmode=disable"
  36. tty: true
  37. ports:
  38. # When XUI_PORT is set, publish the same container port (for example "8080:8080").
  39. - "2053:2053"
  40. restart: unless-stopped
  41. postgres:
  42. image: postgres:16-alpine
  43. container_name: 3xui_postgres
  44. profiles: ["postgres"]
  45. environment:
  46. POSTGRES_USER: xui
  47. POSTGRES_PASSWORD: xui
  48. POSTGRES_DB: xui
  49. volumes:
  50. - $PWD/pgdata/:/var/lib/postgresql/data
  51. restart: unless-stopped