portainer下安装时自定义IP地址

安装一个新的桥接网络

docker network create --subnet 172.18.0.0/16 --gateway 172.18.0.1 npm_app_net

一个X-UI的安装示例,包括自定义IP

version: "3"

services:
  app:
    image: enwaiax/x-ui:latest
    ports:
      - 8801:54321 # 管理面板端口映射
      - 8100-8105:8100-8105/tcp
      - 8100-8105:8100-8105/udp
    tmpfs:
      - /tmp
      - /run
      - /run/lock
    environment:
      TZ: 'Asia/Shanghai'
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
      - /root/data/docker_data/x-ui/x-ui-data/:/etc/x-ui
    restart: unless-stopped
    networks:
      npm_app_net:
        ipv4_address: 172.18.0.3
        
networks:
  npm_app_net:
    external: true

安装NPM

version: "3"
services:
  npm:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      # These ports are in format <host-port>:<container-port>
      - '80:80' # Public HTTP Port
      - '443:443' # Public HTTPS Port
      - '8801:81' # Admin Web Port
      # Add any other Stream port you want to expose
      # - '21:21' # FTP

    # Uncomment the next line if you uncomment anything in the section
    # environment:
      # Uncomment this if you want to change the location of 
      # the SQLite DB file within the container
      # DB_SQLITE_FILE: "/data/database.sqlite"

      # Uncomment this if IPv6 is not enabled on your host
      # DISABLE_IPV6: 'true'
    environment:
      DISABLE_IPV6: 'true'

    volumes:
      - /home/data/docker_data/npm/data:/data
      - /home/data/docker_data/npm/letsencrypt:/etc/letsencrypt
    networks:
      npm_app_net:
        ipv4_address: 172.18.0.2
        
networks:
  npm_app_net:
    external: true

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值