【发布时间】:2016-10-13 05:58:58
【问题描述】:
我已经为this link 之后的python 生产服务器分别配置了uwsgi 和nginx。我已经使用工作配置分别配置了它们。我的 uwsgi 单独工作正常,nginx 单独工作正常。我的问题是我打算使用 docker 进行此设置,并且无法同时运行 uwsgi 和 nginx,即使我使用的是 bash 文件。以下是我的配置中的相关部分。
Dockerfile:
#python setup
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
RUN rm /etc/nginx/sites-enabled/default
RUN ln -s mysite.conf /etc/nginx/sites-enabled/
EXPOSE 80
CMD ["/bin/bash", "start.sh"]
mysite.conf
upstream django {
# server unix:///path/to/your/mysite/mysite.sock; # for a file socket
server 127.0.0.1:8001; # for a web port socket
}
server {
listen 80;
server_name aa.bb.cc.dd; # ip address of the server
charset utf-8;
# max upload size
client_max_body_size 75M; # adjust to taste
location / {
uwsgi_pass django;
include /etc/nginx/uwsgi_params; # the uwsgi_params file
}
}
start.sh:
service nginx status
uwsgi --socket :8001 --module server.wsgi
service nginx restart
service nginx status # ------- > doesn't get executed :(
shell文件的输出
有人可以帮助我如何使用 bash 脚本进行设置吗?
【问题讨论】: