I've been trying to get django to run via uwsgi in a docker container.
I had django running in docker, with its built in web server, but now that I've modified the requirements.txt to include uwsgi, I keep getting the following error message:
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/
So it seems like the url docker is using for pip packages is /simple
, but how did that change? When I first created the container django and psycopg got downloaded fine.
I tried specifying the full URL of the uwsgi package, but that didn't work either.
docker-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