74 lines
2.3 KiB
YAML
74 lines
2.3 KiB
YAML
version: "3.7"
|
||
|
||
services:
|
||
# 默认开启 anonymous 用户,无密码
|
||
# 把容器的数据目录挂载到宿主机数据盘 /data/ftp
|
||
# 默认主动模式,控制端口默认监听 21
|
||
vsftpd-anonymous:
|
||
image: harbor.colben.cn/general/vsftpd:latest
|
||
container_name: vsftpd-anonymous
|
||
restart: "on-failure"
|
||
network_mode: host
|
||
volumes:
|
||
#- type: bind
|
||
# source: ./vsftpd/vsftpd.conf
|
||
# target: /etc/vsftpd/vsftpd.conf
|
||
- type: bind
|
||
source: ./vsftpd/log
|
||
target: /var/log/vsftpd
|
||
- type: bind
|
||
source: /data/ftp
|
||
target: /var/lib/ftp
|
||
|
||
# 默认开启 anonymous 用户,无密码
|
||
# 创建普通用户 user1,uid: 1001,密码: 123456,允许上传下载
|
||
# 把容器的数据目录挂载到宿主机数据盘 /data/ftp
|
||
# 默认主动模式,控制端口监听 3021
|
||
vsftpd-full:
|
||
image: harbor.colben.cn/general/vsftpd:latest
|
||
container_name: vsftpd-full
|
||
restart: "on-failure"
|
||
environment:
|
||
FTP_USER_1001: 'user1:123456'
|
||
VSFTPD_OPTS: '-owrite_enable=YES -olisten_port=8021'
|
||
network_mode: host
|
||
volumes:
|
||
#- type: bind
|
||
# source: ./vsftpd/vsftpd.conf
|
||
# target: /etc/vsftpd/vsftpd.conf
|
||
- type: bind
|
||
source: ./vsftpd/log
|
||
target: /var/log/vsftpd
|
||
- type: bind
|
||
source: /data/ftp/anonymous
|
||
target: /var/lib/ftp
|
||
- type: bind
|
||
source: /data/ftp
|
||
target: /home
|
||
|
||
# 不允许 anonymous 登录
|
||
# 创建普通用户 user2,uid 是 1002,密码: 123456,允许上传下载
|
||
# 创建普通用户 user3,uid 是 1003,密码: 123456,允许上传下载
|
||
# 把容器的数据目录挂载到宿主机数据盘 /data/ftp
|
||
# 开启被动模式,控制端口监听 8021,数据端口监听 8022
|
||
vsftpd:
|
||
image: harbor.colben.cn/general/vsftpd:latest
|
||
container_name: vsftpd
|
||
restart: "on-failure"
|
||
environment:
|
||
FTP_USER_1002: 'user2:123456'
|
||
FTP_USER_1003: 'user3:123456'
|
||
VSFTPD_OPTS: '-oanonymous_enable=NO -owrite_enable=YES -olisten_port=8021 -opasv_min_port=8022 -opasv_max_port=8022'
|
||
network_mode: host
|
||
volumes:
|
||
#- type: bind
|
||
# source: ./vsftpd/vsftpd.conf
|
||
# target: /etc/vsftpd/vsftpd.conf
|
||
- type: bind
|
||
source: ./vsftpd/log
|
||
target: /var/log/vsftpd
|
||
- type: bind
|
||
source: /data/ftp
|
||
target: /home
|
||
|