django in docker

28 views
Skip to first unread message

Larry Martell

unread,
Jul 5, 2016, 7:30:00 PM7/5/16
to django...@googlegroups.com
I am trying to run nginx/uwsgi/django in a docker container. If I
mount the dir with my django project in the container when I create
the container it works fine. But I want to make the image
self-contained and not dependent on the local file system. So I
changed the Dockerfile to copy the dir containing the django project
from the host machine into the image. But then, when I create the
container (without mounting the dir) I get permission denied on all
accesses to that dir (e.g. the socket, the static files, ...).
Everything is world readable and executable. Anyone have any clues as
to what could be causing this?

Josh Crompton

unread,
Jul 5, 2016, 11:14:10 PM7/5/16
to django...@googlegroups.com
Rather than making everything world-readable, I usually create a user
and chown all the directories to that user.

Can you post your Dockerfile?
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACwCsY7Pz7mtEBR%3DKNfwC9AX8WtcvJAutAH-ZMkG9HBYS04Ksw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

Larry Martell

unread,
Jul 6, 2016, 11:45:14 AM7/6/16
to django...@googlegroups.com
I ended up fixed it. Turned out one of the dirs in the path was not
readable. That is, the django app was in /foo/bar/baz and although
/foo and /foo/bar/baz were readable, /foo/bar was not. Once I chmod-ed
that all was well.
Reply all
Reply to author
Forward
0 new messages