easyengine icon indicating copy to clipboard operation
easyengine copied to clipboard

[POC] Using Bind Mounts for Non-root access

Open dhsathiya opened this issue 3 years ago • 3 comments

Context

For non-root access to site files, we have to move from Volume mounts to Bind mounts. It also gives the flexibility to move site files to another location as well as initiate site in a git dir :tada:

Working

  1. Create a site directory to some other path.
mkdir -p /home/vagrant/site/example.com
  1. Copy the contents of app to the new directory
cp /opt/easyengine/sites/example.com/app/* /home/vagrant/site/example.com/
  1. Change permissions of the newly copied files
chown -R home/vagrant/site/example.com/
  1. Update site docker-compose.yml Replace "htdocs:/var/www" with "/home/vagrant/site/example.com:/var/www" under
services > { php , nginx } > volumes
  1. Disable and enable site.

ToDo

  • [x] Need to check host user groups and other related filesystem permissions to make the edits working with www-data user of the container. on host: adduser vagrant www-data maybe this also sudo chmod -R g+w /srv/www

dhsathiya avatar Aug 09 '21 05:08 dhsathiya

@dhsathiya, Re-enabling/refreshing the site reverts the changes made to site's docker-compose.yml back to htdocs:/var/www.

danish17 avatar Sep 27 '21 17:09 danish17

@danish17 that is expected behavior as those commands will recreate the docker-compose file. This POC has to be implemented in the code.

dhsathiya avatar Feb 09 '22 07:02 dhsathiya

yes

docker host mount image

host file system image

dipankardas011 avatar Feb 13 '24 05:02 dipankardas011