title: Auto reloading Django server on Docker
body: <p>I am learning to use Docker and I have been having a problem since yesterday (before I resorted to asking, I started to investigate but I could not solve the problem), my problem is that I have a Django project in my local machine, I also have the same project with Docker, but when I change my local project, it is not reflected in the container that the project is running. I would be very grateful if you could help me with this please. Thank you.</p>
  
  <p>Dockerfile</p>
  
  <pre><code>FROM python:3.7-alpine
  
  ENV PYTHONDONTWRITEBYTECODE 1
  ENV PYTHONUNBUFFERED 1
  
  RUN mkdir /code
  WORKDIR /code
  
  RUN apk update \
      &amp;&amp; apk add --virtual build-deps gcc python3-dev musl-dev \
      &amp;&amp; apk add postgresql-dev \
      &amp;&amp; pip install psycopg2 \
      &amp;&amp; apk del build-deps
  
  RUN pip install --upgrade pip
  RUN pip install pipenv
  
  COPY ./Pipfile /code
  RUN pipenv install --skip-lock --system --dev
  
  COPY ./entrypoint.sh /code
  
  COPY . /code
  
  ENTRYPOINT [ "/code/entrypoint.sh" ]
  </code></pre>
  
  <p>docker-compose.yml</p>
  
  <pre><code># version de docker-compose con la que trabajaremos
  version: '3'
  
  # definiendo los servicios que correran en nuestro contenedor
  services:
    web:
      restart: always
      build: .
      command: gunicorn app.wsgi:application --bind 0.0.0.0:8000 #python manage.py runserver 0.0.0.0:8000
      volumes:
        - .:/code
        - static_volume:/code/staticfiles
        - media_volume:/code/mediafiles
      expose:
        - 8000
      environment:
        - SQL_ENGINE=django.db.backends.postgresql
        - SQL_DATABASE=postgres
        - SQL_USER=postgres
        - SQL_PASSWORD=postgres
        - SQL_HOST=db
        - SQL_PORT=5432
        - DATABASE=postgres
      depends_on:
        - db
      env_file: .env
    db:
      restart: always
      image: postgres:10.5-alpine
      volumes:
        - ./postgres-data:/var/lib/postgresql/data
    nginx:
      restart: always
      build: ./nginx
      volumes:
        - static_volume:/code/staticfiles
        - media_volume:/code/mediafiles
      ports:
        - 1337:80
      depends_on:
        - web
  
  volumes:
    static_volume:
    media_volume:
  </code></pre>
  
  <p>And a little doubt here, is it a good practice to store the environment variables in Dockerfile or docker-compose ?, I use .env but I have seen in many places that they store the variables in docker-compose, as shown in the code of above</p>
  
  <p>I hope you can help me, any recommendation about my project, is very well received, as I comment, I'm new to Docker but I really like it a lot and I would like to learn more about it.</p>