Init: Docker FTP VSFtp
This commit is contained in:
commit
6de8f362ee
15
Dockerfile
Normal file
15
Dockerfile
Normal file
@ -0,0 +1,15 @@
|
||||
FROM registry.sindominio.net/debian
|
||||
|
||||
RUN apt -y update && \
|
||||
apt install -y vsftpd rsyslog
|
||||
|
||||
COPY vsftpd.conf /etc/vsftpd.conf
|
||||
RUN mkdir -p /var/run/vsftpd/empty
|
||||
RUN mkdir /home/ftp
|
||||
ADD entrypoint.sh /
|
||||
|
||||
ENTRYPOINT [ "/bin/sh", "/entrypoint.sh" ]
|
||||
|
||||
CMD ["/usr/sbin/vsftpd"]
|
||||
|
||||
EXPOSE 21
|
12
docker-compose.yml
Normal file
12
docker-compose.yml
Normal file
@ -0,0 +1,12 @@
|
||||
version: "3"
|
||||
services:
|
||||
vsftp:
|
||||
restart: always
|
||||
build: .
|
||||
volumes:
|
||||
- ./data:/home/ftp
|
||||
environment:
|
||||
FTP_USER : user
|
||||
FTP_PASS : pass
|
||||
ports:
|
||||
- "2021:21"
|
10
entrypoint.sh
Executable file
10
entrypoint.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
set -e;
|
||||
|
||||
echo $FTP_USER:$FTP_PASS
|
||||
if [ -z `getent passwd $FTP_USER` ]; then useradd $FTP_USER -d /home/ftp; fi
|
||||
echo "$FTP_USER:$FTP_PASS" | chpasswd
|
||||
|
||||
echo $FTP_USER | tee -a /etc/vsftpd.userlist
|
||||
|
||||
exec $@
|
16
vsftpd.conf
Normal file
16
vsftpd.conf
Normal file
@ -0,0 +1,16 @@
|
||||
listen=YES
|
||||
listen_ipv6=NO
|
||||
connect_from_port_20=YES
|
||||
anonymous_enable=NO
|
||||
local_enable=YES
|
||||
write_enable=YES
|
||||
chroot_local_user=YES
|
||||
allow_writeable_chroot=YES
|
||||
secure_chroot_dir=/var/run/vsftpd/empty
|
||||
pam_service_name=vsftpd
|
||||
pasv_enable=YES
|
||||
pasv_min_port=40000
|
||||
pasv_max_port=45000
|
||||
userlist_enable=YES
|
||||
userlist_file=/etc/vsftpd.userlist
|
||||
userlist_deny=NO
|
Loading…
Reference in New Issue
Block a user