2

Background:

I'm starting to try web deployment on Docker.

So now I have now:

  1. mariadb instance to hold all the data, the data directory is set as volume;
  2. php:fpm instance for individual websites, which volumes are set to the sub-directories of /var/docker/www;
  3. nginx front-end as a individual container, volume is set to /var/docker/www, configuration volume is set as -v /var/docker/nginx/conf.d /etc/nginx/conf.d;

So, there is one thing left, I want to give a ftp account to relating customers to access the sub-directories of /var/www.

For example: /var/docker/www/site1, or /var/docker/www/site2


Question

So, now I want to make a vsftpd image myself, but I was facing to the below questions:

  1. How should I set the user permissions? I will have different ftp users, but the www file owners are all set to root.
  2. (Newbie question) Should I start the vsftpd inside as daemon? Setting listen=NO?
  3. How to set the network? Will that be a NAT problem?

Finally, is there a good overall solution on this problem? To deploy a vsftpd instance on docker host?

Alfred Huang
  • 17,654
  • 32
  • 118
  • 189

1 Answers1

3

I will have different ftp users, but the www file owners are all set to root.

It would be best if those www files could be set to www-data, as this docker-vsftpd/Dockerfile does.
You also have fauria/docker-vsftpd which allows to parameterize the ftp user, but that will be useful only if www files are part of a common group with said ftp users.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • But how can I chroot different ftpusers in different dir? `user1` => `www/site1` and `user2` => `www/sizte2` – Alfred Huang Jan 26 '16 at 06:24
  • Each of these subdirectories should be part of a different group, group common with their respective user. – VonC Jan 26 '16 at 06:34