Error creating docker image of django, gunicorn and nginx

I am not able to get the static files to come up. I’ve tried various settings and directory configurations and so on, but they just turn up as 404s.

The folder structure of application as below

.
├── config
│   └── nginx
│       └── conf.d
│           └── local.conf
├── docker-compose.yml
├── Dockerfile
├── aggre
│   ├── aggre
│   └── manage.py
|   └── static
├── requirements.txt

Settings.py look like

STATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR),'static']
STATIC_ROOT = os.path.join(os.path.dirname(os.path.dirname(BASE_DIR)), 'static')

Dockerfile

FROM python:3.6
ENV PYTHONUNBUFFERED 1
RUN mkdir -p /opt/services/django/src
WORKDIR /opt/services/django/src
COPY requirements.txt /tmp/
RUN pip install --requirement /tmp/requirements.txt
COPY . /tmp/
COPY . /opt/services/django/src
RUN python aggre/manage.py collectstatic --no-input  # <-- here
CMD exec /bin/bash -c "trap : TERM INT; sleep infinity & wait"
EXPOSE 8000
ADD . /opt/services/django/src
CMD ["gunicorn", "--chdir", "aggre", "--bind", ":8000", "aggre.wsgi:application"]

docker-compose.yml

version: '2'
services:
  djangoapp:
    build: .
    volumes:
      - .:/opt/services/django/src
      - static_volume:/opt/services/django/static/
    networks:
      - nginx_network

  nginx:
    image: nginx:1.13
    ports:
      - "80:80"
    volumes:
      - ./config/nginx/conf.d:/etc/nginx/conf.d
      - static_volume:/opt/services/django/static/ 
    depends_on:
      - djangoapp
    networks:
      - nginx_network

networks:
  nginx_network:
    driver: bridge

volumes:
  static_volume: 

local.conf

server {
    listen 80;
    server_name ***.***.io;

    location / {
        proxy_pass http://djangoapp:8000;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_redirect off;
    }
    location /static {
        alias /opt/services/django/static;
    }
}

I am building and running using
**

docker-compose up –built

The application is started successfully but static files are not loaded.
I am getting

“/opt/services/django/src/static/js/bootstrap.js” failed (2: No such
file or directory)
**

Base directory

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(file)))

I am not getting where it is failing to load the static files.

Source: StackOverflow