我一直试图让django通过uwsgi在docker容器中运行.
我已经在Docker中运行了django,内置了Web服务器,但现在我修改了包含uwsgi的require.txt,我收到以下错误消息:
Retrying (Retry(total=4,connect=None,read=None,redirect=None)) after connection broken by ‘NewConnectionError(‘: Failed to establish a new connection: [Errno -2] Name or service not known’,)’: /simple/uwsgi/
所以看起来像url docker是用于pip包是/简单的,但是怎么改变?当我第一次创建容器django和psycopg被下载的罚款.
我尝试指定了uwsgi包的完整URL,但是也没有.
泊坞窗,compose.yaml:
version: '3'
services:
db:
image: postgres
web:
dns: 8.8.8.8
build: .
command: uwsgi --http :8000 --module destExp.wsgi
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
Dockerfile:
FROM python:3.5
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
ADD requirements.txt /code/
RUN pip install -r requirements.txt
ADD . /code/
CMD uwsgi --http :8000 --module destExp.wsgi
最佳答案