|
1 | | -# Full-stack VortexUI deployment: panel + Postgres/TimescaleDB + Redis + one node. |
2 | | -# Generate mTLS certs first (make certs → deploy/certs), then: |
| 1 | +# Single-server VortexUI (Docker): an all-in-one panel that runs xray + sing-box |
| 2 | +# as an in-process local node, fronted by Caddy, with Postgres/TimescaleDB + |
| 3 | +# Redis. The panel and web use host networking so the proxy inbound ports (chosen |
| 4 | +# per inbound) bind directly on the host — the same model as a native install. |
| 5 | +# |
3 | 6 | # docker compose -f deploy/compose.yml up --build -d |
4 | 7 | # docker compose -f deploy/compose.yml exec panel /usr/local/bin/panel admin create \ |
5 | 8 | # --username root --password 'change-me' --sudo |
| 9 | +# |
| 10 | +# For a multi-node fleet, run the lean `panel` target instead and add nodes in |
| 11 | +# the UI (each node a separate `vortex-node` install). |
6 | 12 | services: |
7 | 13 | db: |
8 | 14 | image: timescale/timescaledb:latest-pg16 |
9 | 15 | environment: |
10 | 16 | POSTGRES_USER: vortex |
11 | 17 | POSTGRES_PASSWORD: ${DB_PASSWORD:-vortex} |
12 | 18 | POSTGRES_DB: vortex |
| 19 | + ports: |
| 20 | + - "127.0.0.1:5432:5432" # reachable by the host-networked panel |
13 | 21 | volumes: |
14 | 22 | - db-data:/var/lib/postgresql/data |
15 | 23 | healthcheck: |
16 | 24 | test: ["CMD-SHELL", "pg_isready -U vortex"] |
17 | 25 | interval: 5s |
18 | 26 | timeout: 3s |
19 | 27 | retries: 10 |
| 28 | + restart: unless-stopped |
20 | 29 |
|
21 | 30 | redis: |
22 | 31 | image: redis:7-alpine |
23 | 32 | command: ["redis-server", "--save", "", "--appendonly", "no"] |
| 33 | + ports: |
| 34 | + - "127.0.0.1:6379:6379" |
24 | 35 | healthcheck: |
25 | 36 | test: ["CMD", "redis-cli", "ping"] |
26 | 37 | interval: 5s |
27 | 38 | timeout: 3s |
28 | 39 | retries: 10 |
| 40 | + restart: unless-stopped |
29 | 41 |
|
30 | 42 | panel: |
31 | 43 | build: |
32 | 44 | context: .. |
33 | 45 | dockerfile: deploy/Dockerfile |
34 | | - target: panel |
| 46 | + target: panel-aio |
| 47 | + network_mode: host # bind :8080 + the proxy inbound ports directly on the host |
35 | 48 | depends_on: |
36 | 49 | db: {condition: service_healthy} |
37 | 50 | redis: {condition: service_healthy} |
38 | 51 | environment: |
39 | 52 | VORTEX_HTTP_ADDR: ":8080" |
40 | | - VORTEX_DATABASE_URL: "postgres://vortex:${DB_PASSWORD:-vortex}@db:5432/vortex?sslmode=disable" |
41 | | - VORTEX_REDIS_URL: "redis://redis:6379/0" |
| 53 | + VORTEX_DATABASE_URL: "postgres://vortex:${DB_PASSWORD:-vortex}@127.0.0.1:5432/vortex?sslmode=disable" |
| 54 | + VORTEX_REDIS_URL: "redis://127.0.0.1:6379/0" |
42 | 55 | VORTEX_JWT_SECRET: ${JWT_SECRET:?set JWT_SECRET (openssl rand -hex 32)} |
43 | 56 | VORTEX_TLS_CERT: /certs/panel.crt |
44 | 57 | VORTEX_TLS_KEY: /certs/panel.key |
45 | 58 | VORTEX_TLS_CA: /certs/ca.crt |
| 59 | + # In-process local node (single-server): the panel runs the core itself. |
| 60 | + VORTEX_LOCAL_NODE: "true" |
| 61 | + VORTEX_LOCAL_NODE_NAME: local |
| 62 | + VORTEX_LOCAL_NODE_HOST: ${LOCAL_NODE_HOST:-127.0.0.1} |
| 63 | + VORTEX_CORE: ${CORE:-xray} |
| 64 | + VORTEX_CORE_BIN: /usr/local/bin/${CORE:-xray} |
| 65 | + VORTEX_CORE_CONFIG: /etc/vortex/local-core.json |
| 66 | + VORTEX_CORE_API_PORT: "10085" |
46 | 67 | volumes: |
47 | 68 | - ./certs:/certs:ro |
48 | | - # The panel is reached through the web reverse proxy; expose it directly only |
49 | | - # if you want to hit the raw API. Uncomment to publish on the host: |
50 | | - # ports: |
51 | | - # - "8080:8080" |
52 | | - expose: |
53 | | - - "8080" |
54 | 69 | restart: unless-stopped |
55 | 70 |
|
56 | | - # Web UI: serves the SPA, reverse-proxies /api + /sub to the panel, and |
57 | | - # terminates TLS. With SITE_ADDRESS set to a domain, Caddy auto-provisions a |
58 | | - # Let's Encrypt certificate; otherwise it serves plain HTTP on WEB_PORT. |
| 71 | + # Web UI: serves the SPA, reverse-proxies /api + /sub to the panel on the host, |
| 72 | + # and terminates TLS. With SITE_ADDRESS a domain, Caddy auto-provisions a |
| 73 | + # Let's Encrypt certificate. |
59 | 74 | web: |
60 | 75 | build: |
61 | 76 | context: .. |
62 | 77 | dockerfile: deploy/web.Dockerfile |
| 78 | + network_mode: host |
63 | 79 | depends_on: |
64 | 80 | - panel |
65 | 81 | environment: |
66 | 82 | SITE_ADDRESS: ${SITE_ADDRESS:-:80} |
67 | 83 | ACME_EMAIL: ${ACME_EMAIL:-} |
68 | | - ports: |
69 | | - - "${WEB_PORT:-80}:80" |
70 | | - - "443:443" |
| 84 | + PANEL_UPSTREAM: 127.0.0.1:8080 |
71 | 85 | volumes: |
72 | 86 | - caddy-data:/data |
73 | 87 | - caddy-config:/config |
74 | 88 | restart: unless-stopped |
75 | 89 |
|
76 | | - node: |
77 | | - build: |
78 | | - context: .. |
79 | | - dockerfile: deploy/Dockerfile |
80 | | - target: node |
81 | | - environment: |
82 | | - VORTEX_NODE_LISTEN: ":50051" |
83 | | - VORTEX_CORE: xray |
84 | | - VORTEX_TLS_CERT: /certs/node.crt |
85 | | - VORTEX_TLS_KEY: /certs/node.key |
86 | | - VORTEX_TLS_CA: /certs/ca.crt |
87 | | - volumes: |
88 | | - - ./certs:/certs:ro |
89 | | - ports: |
90 | | - - "50051:50051" |
91 | | - |
92 | 90 | volumes: |
93 | 91 | db-data: |
94 | 92 | caddy-data: |
|
0 commit comments