Code Monkey home page Code Monkey logo

frp-1's Introduction

FRP server for Docker

本镜像用于构建 frp 服务器端

快速使用

在主机上创建 ~/frp 目录,并创建服务器的配置文件 ~/frp/frps.ini,根据需要添加服务端配置信息:

[common]
bind_port = 7000

以下命令创建 frp 服务端容器,客户端可以通过 7000 号端口连通。

sudo docker run -d \
    -v ~/frp/:/etc/frp \
    -p 7000:7000 \
    --name getnas/frp

提示:~/frp 为本地放置 frps.ini 配置文件的目录请自行创建,将映射到容器的 /etc/frp 默认的配置目录。

映射其他端口

假设需要将服务端上 6000 端口映射给客户端的 ssh 服务使用,则使用以下命令创建镜像。需要映射其他端口也是一样,只要在命令中附加 -p port:port 即可。

sudo docker run -d \
    -v ~/frp/:/etc/frp \
    -p 7000:7000 \
    -p 6000:6000 \
    --name getnas/frp

使用 docker-compose 管理容器

创建 docker-compose.yml 文件,添加需要映射的端口,调整需要映射的配置文件目录。

version: '2'

services:
  frp:
    image: getnas/frp
    ports:
      - "7000:7000"
      - "6000:6000"
      - "8081:8081"
    volumes:
      - ~/frp/:/etc/frp

创建并启动容器

sudo docker-compose up -d

检查服务运行状态

sudo docker-compose ps

可以根据需要随时编辑 docker-compose.yml 文件添加新的端口,编辑完成后重启容器。

sudo docker-compose up -d

说明

本项目仅用作构建 frp 的服务器端容器,有关 frp 的使用说明请参考 官方仓库

frp-1's People

Contributors

yuhr123 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.