[英]How to config apache (installed in server) to run a web app (django) in docker?
我已經安裝了一個apache
服務器,並在PHP
為3個網站運行。 我還用django開發了一個移動api,可在4個docker容器(django,redis,elasticsearch,rabbitmq使用fig.sh
)上運行。
因為apache
正在運行,我想保留它並將其配置為在docker容器上運行Web應用程序。 如果是django
應用,我將為此配置mod_wsgi
,但事實並非如此,所以我不知道。
任何想法。 非常感謝。
注意:我在Centos 6.6
上使用docker 1.5
和apache 2.2
。
編輯: Apache
為3個網站的3個域包含3個<VirtualHost *:80 >
。
1 website1.com
2 website2.com
3 website3.com
和我要部署的api在域api.website1.com上運行,是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
有關將Apache代理到使用mod_wsgi的后端Python網站的一般問題的更多信息,請參見:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.