Created
August 22, 2022 01:08
-
-
Save 0xffan/26974d1b300ebcc447c158aec304b99f to your computer and use it in GitHub Desktop.
在 Docker 中部署 VLESS (WebSocket + TLS + Web)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM caddy:builder AS builder | |
RUN caddy-builder \ | |
github.com/caddy-dns/cloudflare | |
FROM caddy:latest | |
COPY --from=builder /usr/bin/caddy /usr/bin/caddy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
your.domain.name { | |
reverse_proxy /ws v2ray://v2ray:36240 { | |
header_up -Origin | |
} | |
root * /usr/share/caddy/public | |
file_server | |
tls example@mail.com { | |
dns cloudflare {env.CLOUDFLARE_API_TOKEN} | |
resolvers 1.1.1.1 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.9" | |
services: | |
caddy: | |
build: ./caddy-cloudflare-dns | |
environment: | |
CLOUDFLARE_EMAIL: 'mail@example.com' | |
CLOUDFLARE_API_TOKEN: 'xxxxxxxxxxxxx' | |
ports: | |
- "80:80/tcp" | |
- "443:443/tcp" | |
volumes: | |
- ./Caddyfile:/etc/caddy/Caddyfile | |
- ./html:/usr/share/caddy | |
- ./config:/config | |
- ./data:/data | |
restart: always | |
v2ray: | |
image: v2fly/v2fly-core | |
expose: | |
- "36240" | |
volumes: | |
- ./v2ray/config.json:/etc/v2ray/config.json | |
restart: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"inbounds": [ | |
{ | |
"port": 36240, | |
"protocol": "VLESS", | |
"settings": { | |
"decryption": "none", | |
"clients": [ | |
{ | |
"id": "your-uuid", | |
"level": 0 | |
} | |
] | |
}, | |
"streamSettings": { | |
"network": "ws", | |
"wsSettings": { | |
"path": "/ws" | |
} | |
} | |
} | |
], | |
"outbounds": [ | |
{ | |
"protocol": "freedom", | |
"settings": {} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment