mirror of
https://github.com/10h30/v2ray-nginx-docker.git
synced 2026-07-11 10:46:09 +09:00
add badges
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore
|
||||
|
||||
.env
|
||||
.idea
|
||||
deploy.sh
|
||||
|
||||
#letsencrypt generated certificates
|
||||
letsencrypt/
|
||||
|
||||
#logs
|
||||
logs/
|
||||
|
||||
#run folder - files in these folders are programme generated
|
||||
run/
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
FROM ubuntu:latest as builder
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install curl -y
|
||||
RUN curl -L -o /tmp/go.sh https://install.direct/go.sh
|
||||
RUN chmod +x /tmp/go.sh
|
||||
RUN /tmp/go.sh
|
||||
|
||||
|
||||
FROM alpine:3.11
|
||||
|
||||
LABEL Maintainer="George Zhou<alphacodinghub@outlook.com >" \
|
||||
Description="V2Ray all-in-one image with ws-tls option based on Alpine Linux." \
|
||||
Language="HTML" \
|
||||
OS="Alpine Linux" \
|
||||
Service="V2Ray" \
|
||||
Content="V2RAY"
|
||||
|
||||
ENV CLIENT_ID "2e5762cc-20d2-42b1-b0ad-cbe55dc5fa35"
|
||||
ENV CLIENT_ALTERID 64
|
||||
ENV CLIENT_WSPATH "/allproducts"
|
||||
#ENV VER=4.23.1
|
||||
ENV PATH /usr/bin/v2ray:$PATH
|
||||
|
||||
# ensure www-data user exists
|
||||
RUN set -eux; \
|
||||
addgroup -g 82 -S www-data; \
|
||||
adduser -u 82 -D -S -G www-data www-data;
|
||||
# 82 is the standard uid/gid for "www-data" in Alpine
|
||||
|
||||
#install v2ray
|
||||
COPY --from=builder /usr/bin/v2ray/v2ray /usr/bin/v2ray/
|
||||
COPY --from=builder /usr/bin/v2ray/v2ctl /usr/bin/v2ray/
|
||||
COPY docker-conf/config.json /etc/v2ray/config.json
|
||||
|
||||
RUN set -ex && \
|
||||
apk update && \
|
||||
apk --no-cache add ca-certificates \
|
||||
nginx \
|
||||
supervisor && \
|
||||
rm -rf /var/cache/apk/* && \
|
||||
mkdir /var/log/v2ray/ &&\
|
||||
chmod +x /usr/bin/v2ray/v2ctl && \
|
||||
chmod +x /usr/bin/v2ray/v2ray
|
||||
|
||||
RUN rm -rf /etc/localtime
|
||||
COPY docker-conf/localtime /etc/
|
||||
|
||||
# configure Nginx
|
||||
COPY docker-conf/nginx.conf /etc/nginx/
|
||||
COPY docker-conf/default.conf /etc/nginx/conf.d/
|
||||
# configure supervisord
|
||||
COPY docker-conf/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
# web content volume
|
||||
VOLUME /var/www/html
|
||||
WORKDIR /var/www/html
|
||||
COPY docker-conf/html/* /var/www/html/
|
||||
RUN chown -R www-data.www-data /var/www
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENTRYPOINT [ "/entrypoint.sh" ]
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
||||
@@ -1,2 +1,31 @@
|
||||
# v2ray-nginx-docker
|
||||
Easy Docker deployment for V2ray + WS +TLS with Nginx, free SSL and Traefik
|
||||
# v2ray-arukas-all-in-one
|
||||
|
||||

|
||||
|
||||
A v2ray docker image work with nginx for Arukas/IBM/okteto
|
||||
|
||||
- v2ray work with websocket
|
||||
- v2ray request proxy_pass by nginx
|
||||
- custom v2ray settings
|
||||
- add environment variables to edit optional setting
|
||||
- CLIENT_ID (default ad806487-2d26-4636-98b6-ab85cc8521f7)
|
||||
- CLIENT_ALTERID (default 64)
|
||||
- CLIENT_WSPATH (default /ws)
|
||||
- VER (default 4.19.1)
|
||||
- don't need custom domain and ssl certificate
|
||||
- only cost 1 pods
|
||||
|
||||
**USE: deploy this image and add default secure route with port 8080 in arukas**
|
||||
|
||||
- path to v2ray: https://your.domain/fuckgfw_letscrossgfw
|
||||
- path to websites: /usr/share/nginx/html/
|
||||
|
||||
实例教程参考 :
|
||||
|
||||
- <a href="https://doubibackup.com/v2ray-ws-tls-nginx.html" target="_blank">V2Ray+WebSocket+TLS+Nginx 配置与使用教程</a>
|
||||
- https://toutyrater.github.io/advanced/wss_and_web.html
|
||||
- https://bawodu.com/openshift-v2ray/
|
||||
- <a href="https://github.com/v2fly/docker">Official Dockerfile</a>
|
||||
- https://github.com/v2ray/ext
|
||||
- https://toutyrater.github.io/app/docker-deploy-v2ray.html
|
||||
- <a href="https://vimcaw.github.io/blog/2018/03/12/Shadowsocks(R)%E8%AE%BE%E7%BD%AE%EF%BC%9A%E7%B3%BB%E7%BB%9F%E4%BB%A3%E7%90%86%E6%A8%A1%E5%BC%8F%E3%80%81PAC%E3%80%81%E4%BB%A3%E7%90%86%E8%A7%84%E5%88%99/">SSR proxy settings - a great explaination</a>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
TAG="4.23"
|
||||
docker build -t alphacodinghub/v2ray-nginx:$TAG .
|
||||
docker build -t alphacodinghub/v2ray-nginx:latest .
|
||||
|
||||
# V2ray versions:
|
||||
# 4.23.1 2020.05.01
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"log": {
|
||||
"access": "/var/log/v2ray/access.log",
|
||||
"error": "/var/log/v2ray/error.log",
|
||||
"loglevel": "debug"
|
||||
},
|
||||
"inbound": {
|
||||
"port": 30003,
|
||||
"listen":"127.0.0.1",
|
||||
"protocol": "vmess",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": "CLIENT_ID",
|
||||
"alterId": CLIENT_ALTERID
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings":{
|
||||
"network":"ws",
|
||||
"wsSettings": {
|
||||
"path": "CLIENT_WSPATH"
|
||||
}
|
||||
}
|
||||
},
|
||||
"outbound": {
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
server {
|
||||
server_name _;
|
||||
listen 80;
|
||||
|
||||
location / {
|
||||
root /var/www/html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
location CLIENT_WSPATH {
|
||||
proxy_redirect off;
|
||||
proxy_pass http://127.0.0.1:30003;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $http_host;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Meta Tag</title>
|
||||
<meta http-equiv="refresh" content="0; url=https://www.baidu.com" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>Welcome to Baidu world!</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Meta Tag</title>
|
||||
<meta http-equiv="refresh" content="0; url=https://www.baidu.com" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>Welcome to Baidu world!</h1>
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
@@ -0,0 +1,30 @@
|
||||
worker_processes 1;
|
||||
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
#gzip on;
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
logfile=/var/log/supervisord.log
|
||||
pidfile=/run/supervisord.pid
|
||||
|
||||
[program:v2ray]
|
||||
command=v2ray -config=/etc/v2ray/config.json
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
redirect_stderr=true
|
||||
autorestart=false
|
||||
startretries=0
|
||||
|
||||
[program:nginx]
|
||||
command=nginx -g 'daemon off;'
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
redirect_stderr=true
|
||||
autorestart=false
|
||||
startretries=0
|
||||
|
||||
# The below configure can be applied when Docker orchestrator like Docker Swarm or K8S is used.
|
||||
# By default, supervisor will attempt to restart a failed process.
|
||||
# Refer to http://supervisord.org/configuration.html for more info.
|
||||
#[eventlistener:processes]
|
||||
#command=stop-supervisor.sh
|
||||
#events=PROCESS_STATE_STOPPED, PROCESS_STATE_EXITED, PROCESS_STATE_FATAL
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
sed -i "s/CLIENT_ID/$CLIENT_ID/g" /etc/v2ray/config.json
|
||||
sed -i "s/CLIENT_ALTERID/$CLIENT_ALTERID/g" /etc/v2ray/config.json
|
||||
sed -i "s#CLIENT_WSPATH#$CLIENT_WSPATH#g" /etc/v2ray/config.json
|
||||
sed -i "s#CLIENT_WSPATH#$CLIENT_WSPATH#g" /etc/nginx/conf.d/default.conf
|
||||
exec "$@"
|
||||
@@ -0,0 +1,23 @@
|
||||
version: '3.7'
|
||||
|
||||
services:
|
||||
################################################
|
||||
#### v2ray server container #####
|
||||
##############################################
|
||||
achanchor-v2ray:
|
||||
image: alphacodinghub/v2ray-nginx
|
||||
container_name: achanchor-v2ray
|
||||
restart: always
|
||||
networks:
|
||||
- web
|
||||
labels:
|
||||
#### Labels define the behavior and rules of the traefik proxy for this container ####
|
||||
traefik.enable: true # <== Enable traefik to proxy this container
|
||||
traefik.http.routers.achanchor-v2ray.rule: Host(`achanchor.${APP_DOMAIN}`) # <== Your Domain Name for the https rule
|
||||
traefik.http.routers.achanchor-v2ray.entrypoints: web-secured # <== Defining entrypoint for https, **ref: line 31
|
||||
traefik.http.routers.achanchor-v2ray.tls.certresolver: mytlschallenge # <== Defining certsresolvers for https
|
||||
|
||||
# networks and volumes
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
Reference in New Issue
Block a user