title: Docker compose file ownership
body: <p>I created Django project with Docker Compose:</p>
  
  <p>Dockerfile</p>
  
  <pre><code>FROM python:2.7
  
  ENV PYTHONUNBUFFERED 1
  
  RUN mkdir /code
  WORKDIR /code
  ADD . /code/
  
  RUN pip install -r requirements.txt
  
  WORKDIR /code/example
  ENTRYPOINT ["python", "manage.py"]
  </code></pre>
  
  <p>docker-compose.yml</p>
  
  <pre><code>postgres:
    image: postgres
    ports:
    - '5432:5432'
  
  django-project:
    build: .
    command: runserver 0.0.0.0:8000
    volumes:
    - .:/code
    ports:
    - '8000:8000'
    links:
    - postgres
  </code></pre>
  
  <p>It work nice.
  But all new files which create through container 'django-project' have root owner and group.</p>
  
  <p>I try add <code>user: user</code> in Compose config for container <code>django-project</code>.
  But got exception <code>User user not found</code>.</p>
  
  <p>I try add <code>user</code> in container with code:</p>
  
  <pre><code>ENV HOME_USER user
  ENV HOME_PASS password
  
  RUN useradd -m -s /bin/bash ${HOME_USER} &amp;&amp; \
      echo "${HOME_USER}:${HOME_PASS}"|chpasswd &amp;&amp; \
      adduser ${HOME_USER} sudo &amp;&amp; \
      echo ${HOME_USER}' ALL=(ALL) NOPASSWD: ALL' &gt;&gt; /etc/sudoers
  </code></pre>
  
  <p>But exception stayed.</p>
  
  <p>How I can apply non-root ownership for all new files which will create through docker container?</p>