Add VLESS+XHTTP Docker Compose project with nginx reverse proxy
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
services:
|
||||
cert-gen:
|
||||
image: alpine:latest
|
||||
volumes:
|
||||
- tls-certs:/etc/nginx/ssl
|
||||
command: >
|
||||
sh -c "
|
||||
apk add --no-cache openssl &&
|
||||
openssl req -x509 -nodes -days 3650 -newkey rsa:2048
|
||||
-keyout /etc/nginx/ssl/key.pem
|
||||
-out /etc/nginx/ssl/cert.pem
|
||||
-subj '/CN=localhost' &&
|
||||
chmod 644 /etc/nginx/ssl/cert.pem /etc/nginx/ssl/key.pem
|
||||
"
|
||||
|
||||
nginx:
|
||||
image: nginx:latest
|
||||
depends_on:
|
||||
cert-gen:
|
||||
condition: service_completed_successfully
|
||||
xray-server:
|
||||
condition: service_started
|
||||
volumes:
|
||||
- ./config/nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
- tls-certs:/etc/nginx/ssl:ro
|
||||
- xray-socket:/dev/shm
|
||||
|
||||
xray-server:
|
||||
image: ghcr.io/xtls/xray-core:latest
|
||||
volumes:
|
||||
- ./config/server.json:/etc/xray/config.json:ro
|
||||
- xray-socket:/dev/shm
|
||||
command: run -c /etc/xray/config.json
|
||||
|
||||
xray-client:
|
||||
image: ghcr.io/xtls/xray-core:latest
|
||||
depends_on:
|
||||
- nginx
|
||||
volumes:
|
||||
- ./config/client.json:/etc/xray/config.json:ro
|
||||
ports:
|
||||
- "6543:6543"
|
||||
command: run -c /etc/xray/config.json
|
||||
|
||||
volumes:
|
||||
tls-certs:
|
||||
xray-socket:
|
||||
Reference in New Issue
Block a user