I have an image for running a django app. If I mount the dir containing the django app 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 Docker file to copy the dir containing the django app from the host machine into the image. But then, when I create the container (without mounting the dir) I get permission denied on the socket. I do remove the socket in the run file so nginx can create a new one, and it’s 666.
I have this in my Dockerfile:
ENV HOME /opt/django/app/
ADD . /tmp/django
RUN cp -rp /tmp/django/* $HOME
And this in my run file:
That is before I start nginx and uwsgi.
And I get this nginx error:
2016/07/05 15:37:48 [crit] 430#0: *1 connect() to unix:/opt/django/app/app.sock failed (13: Permission denied) while connecting to upstream, client: xx.xx.xx.xx, server: , request: “GET / HTTP/1.1”, upstream: “uwsgi://unix:/opt/django/app/app.sock:”, host: “foo.bar.com:8004”
Is there something I am missing that I have to do to get this to work?