使用docker-compose安装frps碰到frps.ini不生效的问题

本来 docker-compose.yml 文件应该这样,但是运行发现配置文件没生效,端口都没打开

version: '3'
services:
     frps:
        image: snowdreamtech/frps:latest
        ports:
            - "20:17000" #通讯端口
            - "27500:17500" #web管理
            - "10022:10022" #用于ssh连接
            - "10080:10080" #http
            - "10443:10443" #https
            # 更多端口根据实际需求增加
            # 左边为主机  右边为docker
        volumes:
            - ./frps.ini:/etc/frp/frps.ini
        container_name: frps
        restart: unless-stopped

于是

docker ps

找到容器名字 frps

执行

docker exec -it frps sh

cd /etc/frp/

进去一看原来名字变成了 frps.toml ,难怪出错

找到原因了解决就简单了,改成下面这样就行了,难道是因为frps版本升级了,默认文件也变了吗?

version: '3'
services:
     frps:
        image: snowdreamtech/frps:latest
        ports:
            - "20:17000" #通讯端口
            - "27500:17500" #web管理
            - "10022:10022" #用于ssh连接
            - "10080:10080" #http
            - "10443:10443" #https
            # 更多端口根据实际需求增加
            # 左边为主机  右边为docker
        volumes:
            - ./frps.ini:/etc/frp/frps.toml
        container_name: frps
        restart: unless-stopped

 



发表评论

您的电子邮箱地址不会被公开。

+ 76 = 82