安装一个新的桥接网络
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