mirror of
				https://github.com/bjdgyc/anylink.git
				synced 2025-11-01 00:59:34 +08:00 
			
		
		
		
	
							
								
								
									
										13
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								Dockerfile
									
									
									
									
									
								
							| @@ -9,13 +9,14 @@ RUN npx browserslist@latest --update-db \ | ||||
|  | ||||
| # server | ||||
| FROM golang:alpine as builder_golang | ||||
| ENV GOPROXY=https://goproxy.io \ | ||||
|     GOOS=linux | ||||
| #TODO 本地打包时使用镜像 | ||||
| #ENV GOPROXY=https://goproxy.io | ||||
| ENV GOOS=linux | ||||
| WORKDIR /anylink | ||||
| COPY . /anylink | ||||
| COPY --from=builder_node /web/ui  /anylink/server/ui | ||||
|  | ||||
| #本地打包时使用镜像 | ||||
| #TODO 本地打包时使用镜像 | ||||
| #RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories | ||||
| RUN apk add --no-cache git | ||||
| RUN cd /anylink/server;go build -o anylink -ldflags "-X main.COMMIT_ID=$(git rev-parse HEAD)" \ | ||||
| @@ -34,9 +35,11 @@ COPY ./server/conf  /app/conf | ||||
| COPY ./server/files  /app/files | ||||
| COPY docker_entrypoint.sh  /app/ | ||||
|  | ||||
| #本地打包时使用镜像 | ||||
| #TODO 本地打包时使用镜像 | ||||
| #RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories | ||||
| RUN apk add --no-cache bash iptables && ls /app | ||||
| RUN apk add --no-cache bash iptables \ | ||||
|     && chmod +x /app/docker_entrypoint.sh \ | ||||
|     && ls /app | ||||
|  | ||||
| EXPOSE 443 8800 | ||||
|  | ||||
|   | ||||
							
								
								
									
										10
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								README.md
									
									
									
									
									
								
							| @@ -130,9 +130,8 @@ systemd 脚本放入: | ||||
| 4. 启动容器 | ||||
|  | ||||
|    ```bash | ||||
|    docker run -itd --privileged \ | ||||
|    -p 443:443 \ | ||||
|    -p 8800:8800 \ | ||||
|    docker run -itd --name anylink --privileged \ | ||||
|    -p 443:443 -p 8800:8800 \ | ||||
|    --restart=always \ | ||||
|    anylink | ||||
|    ``` | ||||
| @@ -140,10 +139,9 @@ systemd 脚本放入: | ||||
| 5. 使用自定义参数启动容器 | ||||
|     | ||||
|    ```bash | ||||
|    docker run -itd --privileged \ | ||||
|    docker run -itd --name anylink --privileged \ | ||||
|    -e IPV4_CIDR=192.168.10.0/24 \ | ||||
|    -p 443:443 \ | ||||
|    -p 8800:8800 \ | ||||
|    -p 443:443 -p 8800:8800 \ | ||||
|    --restart=always \ | ||||
|    anylink -c=/etc/server.toml --admin_addr=:8080 | ||||
|    ``` | ||||
|   | ||||
| @@ -85,5 +85,5 @@ const accountMail = `<p>您好:</p> | ||||
|     </ul> | ||||
| </div> | ||||
| <p> | ||||
|     软件下载地址: https://gitee.com/bjdgyc/anylink-soft/blob/master/README.md | ||||
|     软件下载地址: https://{{.LinkAddr}}/files/info.txt | ||||
| </p>` | ||||
|   | ||||
							
								
								
									
										5
									
								
								server/files/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								server/files/.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -1,5 +0,0 @@ | ||||
| # Binaries for programs and plugins | ||||
|  | ||||
| * | ||||
| !.gitignore | ||||
| !index.html | ||||
							
								
								
									
										2
									
								
								server/files/info.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								server/files/info.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | ||||
| 客户端软件需放置在files目录内, | ||||
| 如需要帮助请加QQ群:567510628 | ||||
| @@ -22,7 +22,7 @@ func LinkHome(w http.ResponseWriter, r *http.Request) { | ||||
| 	} | ||||
|  | ||||
| 	w.WriteHeader(http.StatusOK) | ||||
| 	fmt.Fprintln(w, "hello world") | ||||
| 	fmt.Fprintln(w, "AnyLink 是一个企业级远程办公 sslvpn 的软件,可以支持多人同时在线使用。") | ||||
| } | ||||
|  | ||||
| func LinkOtpQr(w http.ResponseWriter, r *http.Request) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user