Answer the question
In order to leave comments, you need to log in
How to organize work with user access?
Hello. I figured out a little with the docker, but I'm tormented by the issue of access for different users to their projects.
What is available:
The file system of the host machine stores web project files and database files, nginx is running. The container works with MariaDB, stores data in the file system of the host machine, works through volume. Containers work with different versions of PHP and also work with the files of the corresponding projects through volume. Nginx host machine works over TCP with different PHP containers on different ports, proxies to them.
All this works successfully. But I need to give different people access to their project files, respectively. How to do it Feng Shui? Give SFTP and chroot to the host machine? How to be then with the rights of files of projects? Add sshd process to PHP containers and do port forwarding? But as far as I understand, the essence of docker is one container - one process... Can I create separate containers for SFTP and provide the necessary project files through volume ???? How to be?
Answer the question
In order to leave comments, you need to log in
Users go to the host and work with the data on the host as usual.
The volumes are thrown into containers and the containers are launched with the rights of the required users.
Just do ```-u $(id -u $USER1):$(id -g $USER1) \
-v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group :ro \
-v /home/$USER1/www:/var/www```
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question