Skip to content

Instantly share code, notes, and snippets.

@0xffan
Created August 22, 2022 01:08
Show Gist options
  • Save 0xffan/26974d1b300ebcc447c158aec304b99f to your computer and use it in GitHub Desktop.
Save 0xffan/26974d1b300ebcc447c158aec304b99f to your computer and use it in GitHub Desktop.
在 Docker 中部署 VLESS (WebSocket + TLS + Web)
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
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
}
}
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
{
"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