title: How to create files to avoid permission issues in docker?
body: <p>I am new using docker and i have a task to create two containers: one for a django project and another for a mysql server.</p>
  <p>I made it using Dockerfile and docker-compose.yml.
  The project it's working with &quot;docker-compose up&quot;, but i have permission problems when i try to create new files inside the container with &quot;python manage.py startapp app_name&quot;. Basically i can't modify the files inside my ide(pycharm ubuntu). For what i can understand the user in the docker is root, so i need to have root permission to change those files but i don't want to modify them as root or change the permission of those files each time i make them.</p>
  <p>Here is my Dockerfile:</p>
  <pre><code>FROM python:3.9.5
  ENV PYTHONUNBUFFERED 1
  WORKDIR /app
  COPY requirements.txt /app/requirements.txt
  RUN pip install -r requirements.txt
  COPY . /app
  
  CMD python manage.py runserver 0.0.0.0:8000
  </code></pre>
  <p>docker-compose.yml</p>
  <pre class="lang-js prettyprint-override"><code>version: &quot;3.9&quot;
  services:
    backend:
      build:
        context: .
        dockerfile: Dockerfile
      ports:
        - 8000:8000
      volumes:
        - .:/app
      depends_on:
        - mysqldb
  
    mysqldb:
      image: mysql:5.7.34
      restart: always
      environment:
        MYSQL_DATABASE: mydb
        MYSQL_USER: django
        MYSQL_PASSWORD: djangopass
        MYSQL_ROOT_PASSWORD: mysecretpassword
      volumes:
        - .dbdata:/var/lib/mysql
      ports:
        - 3306:3306
  </code></pre>