docker/vsftpd/Demo/docker-compose.yml
2024-10-29 11:24:40 +08:00

74 lines
2.3 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 用户,无密码
# 创建普通用户 user1uid: 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 登录
# 创建普通用户 user2uid 是 1002密码: 123456允许上传下载
# 创建普通用户 user3uid 是 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