selloween / docker-multi-wordpress

Run multiple WordPress Docker containers with NGINX Proxy, LetsEncrypt and PHP Composer
GNU General Public License v3.0
75 stars 18 forks source link

Volume Mount Issue.. #1

Closed brandontamm closed 5 years ago

brandontamm commented 5 years ago

I git clone'd the repo for testing because I am super interested in the architecture you developed.

I had an issue on the initial docker-compose up of the Nginx stack: `Creating nginx ... error

ERROR: for nginx Cannot start service nginx: b'Mounts denied: \r\nThe paths /srv/nginx/data/html and /srv/nginx/data/vhost.d and /srv/nginx/data/certs and /srv/nginx/data/conf.d\r\nare not shared from OS X and are not known to Docker.\r\nYou can configure shared paths from Docker -> Preferences... -> File Sharing.\r\nSee https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.\r\n.'

ERROR: for nginx Cannot start service nginx: b'Mounts denied: \r\nThe paths /srv/nginx/data/html and /srv/nginx/data/vhost.d and /srv/nginx/data/certs and /srv/nginx/data/conf.d\r\nare not shared from OS X and are not known to Docker.\r\nYou can configure shared paths from Docker -> Preferences... -> File Sharing.\r\nSee https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.\r\n.' ERROR: Encountered errors while bringing up the project.`

I noticed almost all of the volume mounts in the nginx docker-compose file and also the individual website directories are referring to folders that don't currently exist so it's throwing error. Any guidance on how I should proceed with mounting the volumes to get this concept working? I love the idea!

selloween commented 5 years ago

Hi!

/srv is a directory of the Linux filesystem as you can run this setup in production. You can change the paths to any directory on your host system (in your case OSX) - i'd suggest replacing /srv with . e.g. ./nginx/data/certs. This will create the folders in the root directory of the docker-compose.yml

Thanks for bringing this up, I will be adding this to the Readme as this will affect local Windows environments too.

Hope this helps.