Docker Community Forums

Share and learn in the Docker community.

Nginx volume docker


(Andradeth) #1

Good Morning,

I have a server with multiple container dockers.
I need to access a volume from a container where it contains attachment images via NGINX from the server outside the container, so let’s say the volume folder on the server is / var / lib / docker / volumes / attachments.
If I put this path in a location of nginx, it will return me as 403 Forbiden.

location / attachments {
root / var / lib / docker / volumes / attachments;
}

My question is, if I set the permissions of this folder to nginx, I can compromise the functionality of this volume in docker.

Which alternative can these attachments be accessed by my nginx?

Att.


(Jmiraglia) #2

Using a shared volume between containers: https://docs.docker.com/docker-cloud/apps/volumes/