How do I serve static files from either gunicorn or nginx

I am playing with a docker project. Django+gunicorn in one container, nginx in another container.

When I switched over from the Django dev server to gunicorn, I noticed that all my static files weren’t being served. I’ve been trying to troubleshoot this for days thinking it was an nginx issue, but if I visit the container of Django/gunicorn (and not nginx), I also don’t see static files showing up here, so this makes me think it is not an nginx issue but just a simple error in my Django settings?

  • What should WSO2 APIM <localMemberHost> parameter contain in the config and what it is used by the APIM?
  • swift build faild due to “database is locked” in docker contianer?
  • How can I get a docker container to load text from /etc/motd
  • How to send node.js logs to Cloudwatch Logs from Elastic Beanstalk Docker application?
  • docker-machine, create and run a nginx container is not exposing port 80
  • Docker Keep Exiting (Deploying MS SQL on MAC osx)
  • Django

    DEBUG = False
    STATIC_ROOT = os.path.join(PACKAGE_ROOT, "static1")
    STATIC_URL = "/static/"
        os.path.join(PACKAGE_ROOT, "static"),


    server {
        listen 80;
        charset utf-8;
        location /static {
            alias /root/proj/proj/static;

    Note: I set this alias to /root/proj/proj/static, because this is the directory path to where static files are actually located inside the Django/gunicorn container… Am I correct in setting the alias to this path?


      build: ./parentserver
        - "8000"
        - postgres:postgres
        - authserver:authserver
        - /usr/src/app
        - /usr/src/app/static
      env_file: .env
        DEBUG: 'true'
      command: ./
      build: ./nginx/
        - "80:80"
        - /www/static
        - parentserver
        - parentserver:parentserver

    Are my volumes set wrong?

    Would appreciate any feedback suggestions.

  • Docker: Change word in file at container startup
  • Container Based Application Clustering System
  • Dynamically start new Docker containers when needed?
  • Unable to connect the client to the server using Docker COntainers
  • Kubernetes pod running out of memory when writing to a volume mount
  • running docker from gradle: cannot pull image
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.