title: What's the meaning of RUN mkdir /code and ADD . /code/
body: <p>I'm now following instructions of Docker to create a Django+MySQL project. But for the Dockerfile, could any one explain why we have these two lines?</p>
  
  <pre><code>FROM python:2.7
  ENV PYTHONUNBUFFERED 1
  RUN mkdir /code  &lt;=====Why we need to mkdir here, will /code dir be delete after build?
  RUN mkdir /code/db
  WORKDIR /code
  ADD ./mysite/requirements.txt /code/  &lt;==For my understanding, here we copy our local requirements file into image's /code dir?
  RUN pip install -r requirements.txt
  ADD . /code/  &lt;== What's this step doing? Copying all my current dir's content into /code? why we do this?
  </code></pre>
  
  <p>And in the docker-compose.yml, there are lines like this:</p>
  
  <pre><code>web:
    build: .
    command: python ./mysite/manage.py runserver 0.0.0.0:8000
    volumes:
     &lt; - .:/code &gt; 
    ports:
      - "8000:8000"
    links:
      - db
  </code></pre>