亲宝软件园·资讯

展开

Docker frp部署 Docker内网穿透frp部署实现过程解析

-零 人气:0

1.创建配置文件目录

cd /home目录

mkdir frp

最后的目录结构:

2.创建服务端配置文件

vi frps.ini

[common]
bind_port = 17000
token = myToken
vhost_http_port = 10080
vhost_https_port = 10443
 
dashboard_port = 17500
dashboard_user = admin
dashboard_pwd = admin
 
 
tcp_mux = true
max_pool_count = 10

3.创建服务端yml文件

vi frps-docker-compose.yml

version: '3'
services:
 
  frps:
    image: snowdreamtech/frps
    ports:
      - "17000:17000"
      - "27500:17500"
      - "10022:10022" #用于ssh连接
      - "10080:10080" #用于开放给外网访问
      # 更多端口根据实际需求增加
    volumes:
      - ./frps.ini:/etc/frp/frps.ini container_name: frps

4.启动服务端

docker-compose -f frps-docker-compose.yml up 注意:开启后台运行-d

5.创建客户端配置文件

vifrpc.ini

[common]
#服务器ip
server_addr = x.x.x.x
server_port = 17000
token = myToken
 
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 10022
use_encryption = true
use_compression = true
 
[pi.mydomain.com]
type = http
local_port = 80
custom_domains = pi.mydomain.com

6.创建客户端yml文件

vi frpc-docker-compose.yml

version: '3'
services:
  frpc:
    image: cloverzrg/frpc-docker
    volumes:
      - ./frpc.ini:/conf/frpc.ini
    container_name: frpc
    network_mode: host

8.启动客户端

docker-compose -f frpc-docker-compose.yml up -d

参考:https://liyangweb.com/service/358.html

frp中文文档:https://www.cnblogs.com/yanglang/p/12035934.html

加载全部内容

相关教程
猜你喜欢
用户评论