docker搭建nps

本文最后更新于 2024年5月16日。

yml文件nps-docker-compose.yml

version: "3.7"
services:
  frps:
    image: ffdfgdfg/nps
    container_name: nps
    hostname: frps
    restart: unless-stopped
    ports:
      - "7443:8080"
    #   # - 7400:7400
    #   - 7000:7000
    #   - 8888:8888
    volumes:
      - nps:/conf
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.nps.entrypoints=websecure"
      - "traefik.http.routers.nps.rule=Host(`nps.weiyoun.com`)"
      - "traefik.http.routers.nps.tls.certresolver=lets-encr"
      - traefik.http.routers.nps.service=nps #多路由必须定义不同的服务名
      - "traefik.http.services.nps.loadbalancer.server.port=8080"
      - "traefik.docker.network=proxy"
      # - "traefik.http.routers.frpshttp.entrypoints=websecure"
      # - "traefik.http.routers.frpshttp.rule=Host(`frpshttp.weiyoun.com`)"
      # - "traefik.http.routers.frpshttp.tls.certresolver=lets-encr"
      # - traefik.http.routers.frpshttp.service=frpshttp #多路由必须定义不同的服务名
      # - "traefik.http.services.frpshttp.loadbalancer.server.port=8888"
      # - "traefik.http.routers.a.entrypoints=websecure"
      # - "traefik.http.routers.a.rule=Host(`a.weiyoun.com`)"
      # - "traefik.http.routers.a.tls.certresolver=lets-encr"
      # - traefik.http.routers.a.service=a #多路由必须定义不同的服务名
      # - "traefik.http.services.a.loadbalancer.server.port=8888"
      # # - "traefik.docker.network=proxy"
networks:
  default:
    external:
      name: traefik
volumes:
  nps:

下载配置文件放入映射的文件夹下:

-   下载[conf文件夹](https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/ehang-io/nps/tree/master/conf)并解压,或前往[项目主页](https://github.com/ehang-io/nps)自行下载**(升级请忽略)**
-   继续阅读[文档](https://ehang-io.github.io/nps/#/example)按照不同的启动方式启动**(升级请忽略)**

就可以用域名访问了。