How to config apache (installed in server) to run a web app (django) in docker?

I have a apache server installed and running for 3 website in PHP. I also developed a mobile api in django running on 4 docker containers
(django, redis, elasticsearch, rabbitmq using fig.sh).

Because apache is running and I want to keep it and configure it to run the web app on the docker containers. if it is django app I will config mod_wsgi for that but it is not so I don’t know.

  • Docker+Rails+Postgres: app can't access database container
  • docker-compose adding to PATH
  • Is this Docker / NGINX / Node setup actually load balancing as expected?
  • Why is my dockerfile not copying directories
  • How to mount a Windows's folder in Docker using Powershell (or CMD)?
  • Get the same output of the nproc command in Python
  • Any idea about that. Thank a lot.

    Note: I am using docker 1.5 and apache 2.2 on Centos 6.6.

    Edit:
    Apache is contain 3 <VirtualHost *:80 > for 3 domain of 3 website.

    1 website1.com

    2 website2.com

    3 website3.com

    and api I want to deploy is running on domain api.website1.com is subdomain of website1.com

    fig.yml

    db:
      image: mysql
      volumes:
        - /var/lib/mysql:/var/lib/mysql
      volumes_from:
        - mysql_data
      ports:
        - "3306:3306"
      environment:
        MYSQL_ROOT_PASSWORD: 123
      # command:
    
    
    redis:
     image: redis:3
    
    elasticsearch:
     image: elasticsearch
     ports:
       - "9200:9200"
       - "9300:9300"
    
    rabbitmq:
     image: tutum/rabbitmq
     environment:
       - RABBITMQ_PASS=123456
     ports:
       - "5672:5672"  # we forward this port because it's useful for debugging
       - "15672:15672"  # here, we can access rabbitmq management plugin
    
    web:
      build: .
      command: python3 manage.py runserver 0.0.0.0:8000
      volumes:
        - .:/code
      ports:
        - "8000:8000"
    
      links:
       - db:db
       - elasticsearch:elasticsearch
       - rabbitmq:rabbit
       - redis:redis
    
    # container with redis worker
    worker:
      build: .
      command:
      volumes:
        - .:/code/mobile_api
      links:
        - db:db
        - rabbitmq:rabbit
        - redis:redis
    

  • How to export a named docker volume on a Mac?
  • Apt-get not working behind firewall even setting Fiddler as a tunnel
  • Postgres in Docker; two instances clashing ports
  • docker pull gets me the error: “Download failed, retrying: x509: certificate signed by unknown authority”
  • Dockerizing simple webbapp: how to pick what goes in which container?
  • How to fix “Pseudo-terminal will not be allocated because stdin is not a terminal” in Alpine Linux?
  • One Solution collect form web for “How to config apache (installed in server) to run a web app (django) in docker?”

    For more information about the general issues around proxying Apache to backend Python web sites which use mod_wsgi, see:

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.