title: Why python manage.py collectstatic do not copy files to correct location?
body: <p>The problem I am facing is that my Django project can't find <strong>static files</strong>.</p>
  
  <p>I was struggling with this issue for quite a while hence, 
  now <strong>I figured where the problem is</strong> however, I have <strong>no idea how to fix it</strong>. </p>
  
  <p><em>Real static files location:</em></p>
  
  <ol>
  <li>ls /code/jk/static/jk/css/main.css</li>
  <li>ls /code/jk/static/jk/js/main.js</li>
  </ol>
  
  <p>When running: <code>RUN (python /code/jk/manage.py collectstatic --noinput)</code>
  <strong>I noticed that this provides me a wrong location:</strong></p>
  
  <pre><code>...
  61 static files copied to '/code/jk/jk/static', 2 unmodified.
  ...
  </code></pre>
  
  <p>There is redundant  <code>'/code/jk/jk/static'</code> in the path and I have no idea how to change it.</p>
  
  <p><strong><em>settings.py</em></strong></p>
  
  <pre><code>...
  STATIC_DIR = os.path.join(BASE_DIR, 'static')
  STATIC_URL = '/static/'
  STATICFILES_DIRS = [STATIC_DIR]
  
  PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
  STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
  
  MEDIA_DIR = os.path.join(BASE_DIR, 'media')
  MEDIA_URL = '/media/'
  MEDIA_ROOT = MEDIA_DIR
  ...
  </code></pre>
  
  <p>I am using Django application in docker as following:</p>
  
  <p><strong><em>Dockerfile</em></strong></p>
  
  <pre><code>FROM python:3
  
  ENV PYTHONUNBUFFERED 1
  RUN mkdir /code
  WORKDIR /code
  COPY . /code/
  RUN (pip install -r reqirements.txt)
  RUN (python /code/jk/manage.py migrate)
  RUN (python /code/jk/manage.py collectstatic --noinput)
  RUN (python /code/jk/manage.py migrate)
  # clean packages
  RUN apt-get clean
  RUN rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
  ENTRYPOINT ["/code/jk/start_gunicorn.sh"]
  </code></pre>
  
  <p><strong><em>start_gunicorn.sh</em></strong></p>
  
  <pre><code>#!/bin/bash
  cd /code/jk/
  touch ./gunicorn.log
  touch ./gunicorn-access.log
  tail -n 0 -f ./gunicorn*.log &amp;
  #export DJANGO_SETTINGS_MODULE=projectx.settings
  exec gunicorn jk.wsgi \
      --bind 0.0.0.0:8000 \
      --workers 3 \
      --log-level=info \
      --log-file=./gunicorn.log \
      --access-logfile=./gunicorn-access.log \
  "$@"
  </code></pre>