Browse Source

add docker

liuyuqi-dellpc 1 year ago
parent
commit
b6ea7d8295
9 changed files with 160 additions and 1 deletions
  1. 25 0
      .dockerignore
  2. 19 0
      Dockerfile
  3. 13 1
      README.md
  4. 12 0
      docker-compose.debug.yml
  5. 13 0
      docker-compose.yml
  6. 5 0
      frp-start.bat
  7. 8 0
      frp-start.sh
  8. 36 0
      frpc.ini
  9. 29 0
      frps.ini

+ 25 - 0
.dockerignore

@@ -0,0 +1,25 @@
+**/.classpath
+**/.dockerignore
+**/.env
+**/.git
+**/.gitignore
+**/.project
+**/.settings
+**/.toolstarget
+**/.vs
+**/.vscode
+**/*.*proj.user
+**/*.dbmdl
+**/*.jfm
+**/bin
+**/charts
+**/docker-compose*
+**/compose*
+**/Dockerfile*
+**/node_modules
+**/npm-debug.log
+**/obj
+**/secrets.dev.yaml
+**/values.dev.yaml
+LICENSE
+README.md

+ 19 - 0
Dockerfile

@@ -0,0 +1,19 @@
+#build stage
+FROM golang:alpine AS builder
+RUN apk add --no-cache git
+WORKDIR /go/src/app
+RUN go get github.com/fatedier/frp ;\
+    cd github.com/fatedier/frp ;\
+    make
+
+#final stage
+FROM alpine:latest
+RUN apk --no-cache add ca-certificates
+WORKDIR /app
+COPY --from=builder /go/src/app/github.com/fatedier/frp/bin/* /app/
+COPY frps.ini .
+VOLUME [ "/data" ]
+LABEL Name=frp Version=0.0.1
+ENV PATH=$PATH:/app
+EXPOSE 7000 7500 90
+ENTRYPOINT [ "/app/frp" ]

+ 13 - 1
README.md

@@ -1,3 +1,15 @@
 # frp
 
-内网穿透
+内网穿透
+
+## Usage
+
+docker方式部署:
+```
+docker build -t jianboy/frp:latest .
+docker run jianboy/frp:latest
+```
+
+客户端:
+
+下载exe文件,修改frpc.ini配置文件,运行frpc.exe 或者 frp-start.bat

+ 12 - 0
docker-compose.debug.yml

@@ -0,0 +1,12 @@
+version: '3.4'
+
+services:
+  frp:
+    image: frp
+    build:
+      context: .
+      dockerfile: ./Dockerfile
+    ports:
+      - 7000:7000
+      - 7500:7500
+      - 90:90

+ 13 - 0
docker-compose.yml

@@ -0,0 +1,13 @@
+version: '3.4'
+
+services:
+  frp:
+    image: jianboy/frp:latest
+    # build:
+    #   context: .
+    #   dockerfile: ./Dockerfile
+    ports:
+      - 7000:7000
+      - 7500:7500
+      - 90:90
+

+ 5 - 0
frp-start.bat

@@ -0,0 +1,5 @@
+@echo off
+
+echo     ´ò¿ªapache:      http://http88.ok.yoqi.me:90
+
+frpc.exe -c frpc.ini

+ 8 - 0
frp-start.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+# @Contact :   liuyuqi.gov@msn.cn
+# @Time    :   2023/11/08 16:46:45
+# @License :   (C)Copyright 2022 liuyuqi.
+# @Desc    :   start frp
+###############################################################################
+
+frpc -c frpc.ini

+ 36 - 0
frpc.ini

@@ -0,0 +1,36 @@
+[common]
+    server_addr = freefrp-us.marisalnc.com
+    server_port = 7000
+    token = marisalnc.com
+
+    #log_file = ./frpc.log
+    ## trace, debug, info, warn, error
+    #log_level = warn
+    #log_max_days = 3
+    admin_addr = 127.0.0.1
+    admin_port = 7400
+    #admin_user = lyq
+    #admin_passwd = admin
+    pool_count = 5
+    tcp_mux = true
+
+    enable_prometheus = true
+
+
+
+# http://nginx.ok.yoqi.me:90
+[nginxfdfdf]
+    type = http
+    local_ip = 127.0.0.1
+    local_port = 5000
+    use_encryption = false
+    use_compression = true
+    #http_user = admin
+    #http_pwd = admin
+    subdomain = nginx2334
+    #custom_domains = hfs.ok.yoqi.me
+    # locations is only available for http type
+    #locations = /,/pic
+    #host_header_rewrite = ok.yoqi.me
+    # params with prefix "header_" will be used to update http request headers
+    #header_X-From-Where = ok

+ 29 - 0
frps.ini

@@ -0,0 +1,29 @@
+[common]
+	bind_addr = 0.0.0.0
+	bind_port = 7000
+	#bind_udp_port = 7001
+	#kcp_bind_port = 7000
+	vhost_http_port = 90
+	#vhost_https_port = 443
+	
+	#dashboard_addr = 0.0.0.0
+	#dashboard_port = 7500
+	#dashboard_user = twtech
+	#dashboard_pwd = 4NVK5NV
+	
+	log_file = ./frps.log
+	log_level = info
+	log_max_days = 3
+	token = 18545
+	#allow_ports = 2000-3000,3001,3003,4000-50000
+	#max_pool_count = 5
+	#max_ports_per_client = 0
+	#authentication_timeout = 900
+	subdomain_host = ok.yoqi.me
+	tcp_mux = true
+
+#[ssh]
+#	type = tcp
+#	token = 18545
+#	bind_addr = 0.0.0.0
+#	listen_port = 6000