Tag: uwsgi

docker运行找不到应用程序

我的项目结构是: /docker-test /app /static …. /templates …. -__init__.py …. -nginx.conf -supervisord.conf -uwsgi.ini -Dockerfile -app.py -requirements.txt 我通常通过进入/ docker-test> python app.py来运行应用程序 Dockerfile: FROM python:2.7 # Install uWSGI RUN pip install uwsgi # Standard set up Nginx ENV NGINX_VERSION 1.9.11-1~jessie RUN apt-key adv –keyserver hkp://pgp.mit.edu:80 –recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \ && echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" >> /etc/apt/sources.list \ && […]

为什么nginx在向链接的docker容器做`uwsgi_pass`时返回502?

我使用Docker Compose编排由Django Web应用程序和nginx反向代理组成的多容器应用程序。 我正在盯着一个简单的testing案例,但我已经遇到了障碍。 应用程序应通过uwsgi_pass通过networking套接字( frontend:8000 )将所有的请求传递给Django应用程序。 但是,在启动docker-compose up的应用程序并且看到没有错误消息后,任何请求/在控制台中产生以下错误消息: gateway_1 | 2016/01/11 15:45:12 [error] 8#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.99.1, server: localhost, request: "GET / HTTP/1.1", upstream: "uwsgi://172.17.0.2:8000", host: "192.168.99.100:8000" gateway_1 | 2016/01/11 15:45:12 [error] 8#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.99.1, […]

如何在不同的Docker容器中运行uWSGI和NGINX

我已经在本地设置了uWSGI和NGINX,并且我的configuration在提供Web请求时没有问题。 但是,当我装载uWSGI和NGINX(在单独的Docker容器中)时,我似乎无法build立连接。 我的NGINX服务器configuration如下所示: server { listen 80; server_name localhost; location / { include uwsgi_params; uwsgi_pass uwsgi.app:9090; } } 我的uWSGI ini文件如下所示: [uwsgi] socket = localhost:9090 module = uwsgi:app processes = 4 threads = 2 master = true buffer-size = 32768 stats = localhost:9191 die-on-term = true vaccuum = true 我运行在同一个用户生成的网桥使用以下uWSGI docker run -p 9090:9090 –network main […]

在vmware的stream浪汉docker中的uwsgi – socket没有被创build

在我的Mac上,我在VMware中运行Windows Server 2016。 在那里,我在vagrant / Virtual Box中运行Ubuntu。 在那里,我试图在nginx / uwsgi的docker容器中运行一个django应用程序。 uwsgi未能开始: [uWSGI] getting INI configuration from /opt/django/CAPgraph/uwsgi.ini *** Starting uWSGI 2.0.15 (64bit) on [Thu Aug 17 20:01:23 2017] *** compiled with version: 6.4.0 20170805 on 17 August 2017 06:10:50 os: Linux-3.13.0-128-generic #177-Ubuntu SMP Tue Aug 8 11:40:23 UTC 2017 nodename: 37db4344b5ae machine: x86_64 clock source: […]

集装箱模式的最佳实践

我使用https://hub.docker.com/r/tiangolo/uwsgi-nginx图像docker化Python webapp,该图像使用supervisor来控制uWSGI实例。 我的应用程序实际上需要一个额外的主pipe介导的过程来运行(LibreOffice无头,我通过appy模块生成文档),我想知道什么是适当的模式来实现它。 我看到的方式,我可以扩展上面的图像与额外的主pipeconfiguration我的需要(以及所有必要的操作系统级别的安装步骤),但这将是矛盾的一般原则运行最less量的独特在给定的容器中的进程。 但是,由于我的Python应用程序只能在本地与LibreOffice进行交stream,所以我不确定如何以更集装箱的方式实现它。 感谢您的任何帮助或build议。

从Docker启动uwsgi

我试图“dockerize”我的web应用程序使用uwsgi。 我的问题是,当我从Dockerfile运行uwsgi –ini uwsgi.ini uwsgi.ini它不会启动uwsgi进程。 我究竟做错了什么? 我的Dockerfile看起来像这样(简化): RUN mkdir /home/webapp/configuration ADD uwsgi.ini /home/webapp/configuration RUN uwsgi –ini /home/webapp/configuration/uwsgi.ini 图像生成时输出: Step 26 : RUN uwsgi –ini /home/webapp/configuration/uwsgi.ini —> Running in 832a29ebf40e [uWSGI] getting INI configuration from /home/webapp/configuration/uwsgi.ini —> 3125dbfb1a75 非常奇怪的是,uWSGI正在获取INIconfiguration,但是这个过程并没有启动。

使用Docker实例制作Web服务器 – 什么地方在哪里?

我刚才遇到了Docker,并且一直在做一些研究,但是有一点对我来说还是有点不清楚。 在Docker创build者观看的video中,他将这个工具比作一个集装箱,这样你就可以保证你的堆栈在里面工作正常。 但是我看到很多的容器图像,只是一个单一的部分,即nginx图像或uwsgi图像。 基本上我想运行一个使用python,flask,nginx和uwsgi的web服务器。 它们都是堆栈的一部分,所以它们应该放在一个容器中,还是应该放在自己的容器中? 我也会有一个MySQL服务器,而且这似乎更合乎逻辑地运行在自己的容器中。 如果这是一个意见的问题,表示歉意,但对我来说,感觉就像只有一个正确的方式去做这件事。

了解chroot

我在Docker容器中运行用户应用程序,一切都还好,直到我决定使用supervisorctl,以便我可以通过rpc远程启动/停止应用程序。 现在我需要一种方法来阻止用户的应用程序自动检查容器,发现supervisord.conf&logs和/或执行supervisord / supervisorctl bin。 做到这一点的方法是使用chroot,但我不清楚如何做到这一点。 阅读uwsgi的文档需要做的就是运行 mkdir -p /ns/001 debootstrap maverick /ns/001 chroot /ns/001 # in the chroot jail now adduser uwsgi apt-get install mercurial python-flask su – uwsgi # as uwsgi now git clone https://github.com/unbit/uwsgicc.git . exit # out of su – uwsgi exit # out of the jail Now on your real […]

Docker容器中的Django + uWSGI / nginx – ImportError:没有名为.wsgi的模块

这是一个古老的Django(v1.3.7)应用程序,我正在迁移到一个Docker设置。 基本框架来自这个dockerfiles回购 。 我可以使用Django内置的开发服务器( ./manage.py runserver )使应用程序正常运行,但是我希望在生产中使用uWSGI / Nginx。 我可以得到uwsgi运行没有错误,当我从容器内的bash提示符调用它,如下所示: uwsgi –http :8000 –wsgi-file /home/docker/code/siteweb/glrimon.wsgi但是,当我尝试从Django shell导入我的wsgi文件我得到相同的导入错误。 这是当我启动容器(通过supervisord调用/usr/local/bin/uwsgi –ini /home/docker/code/uwsgi.ini )时logging的内容: [uWSGI] getting INI configuration from /home/docker/code/uwsgi.ini *** Starting uWSGI 2.0.15 (64bit) on [Tue May 9 13:35:14 2017] *** compiled with version: 5.4.0 20160609 on 05 May 2017 18:06:55 os: Linux-3.16.0-77-generic #99~14.04.1-Ubuntu SMP Tue Jun 28 […]

无法使用uwsgi和Docker查看我的简单烧瓶应用程序

我是Docker的新手,尝试在Mac上使用uwsgi和Docker运行一个简单的Flask应用程序。 但是,我无法在我提供的IP和端口上查看它。 我有以下代码结构和它的内容: app – app.py – Dockerfile – requirements.txt – docker-compose.yml – uwsgi.ini app.py from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello World!' if __name__ == "__main__": app.run(host='0.0.0.0', debug=True) Dockerfile FROM python:2.7 MAINTAINER Sanjiv Kumar ENV PYTHONUNBUFFERED 1 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app ADD requirements.txt /usr/src/app/ RUN pip install […]