1
0

」 feat: finished last containers

This commit is contained in:
2025-03-04 10:47:25 +01:00
parent 57387462cf
commit 1538afbc7b
12 changed files with 1092 additions and 4 deletions

View File

@ -0,0 +1,18 @@
FROM scratch
ADD docker/alpine/alpine-minirootfs-3.21.2-x86_64.tar.gz /
RUN apk add vsftpd
COPY docker/bonus/vsftpd/entry.sh /docker-entrypoint
COPY docker/bonus/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf
RUN chmod +x /docker-entrypoint
EXPOSE 21
EXPOSE 30000-30100
VOLUME /var/ftp
STOPSIGNAL SIGTERM
ENTRYPOINT [ "/docker-entrypoint" ]
CMD [ "vsftpd", "/etc/vsftpd/vsftpd.conf" ]

View File

@ -0,0 +1,28 @@
#!/bin/sh
# Environment variables:
# VSFTPD_USER: Username for the vsftpd user
# VSFTPD_PASSWORD: Password for the vsftpd user
DONE_FILE=/vsftpd.ok
if [ -f "${DONE_FILE}" ]; then
echo "[*] vsftpd already setup, skipping"
else
echo "[*] Creating vsftpd user"
adduser -D $VSFTPD_USER
echo "$VSFTPD_USER:$VSFTPD_PASS" | /usr/sbin/chpasswd > /dev/null
echo "[*] Giving vsftpd user ownership of WordPress data directory"
chown -R "$VSFTPD_USER:$VSFTPD_USER" /var/ftp
echo $VSFTPD_USER | tee -a /etc/vsftpd/vsftpd.userlist > /dev/null
touch ${DONE_FILE}
fi
mkdir /var/run/vsftpd/empty -p
echo "[*] Starting '$@'"
exec "$@"

View File

@ -0,0 +1,25 @@
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
ftpd_banner=Welcome to your WordPress FTP server.
chroot_local_user=YES
allow_writeable_chroot=YES
user_sub_token=$USER
local_root=/var/ftp
listen=YES
listen_port=21
listen_address=0.0.0.0
seccomp_sandbox=NO
pasv_enable=YES
pasv_min_port=30000
pasv_max_port=30100
userlist_enable=YES
userlist_file=/etc/vsftpd/vsftpd.userlist
userlist_deny=NO