这个页面正在工作 – Docker

我有一个本地docker镜像,正在运行一个django项目。 泊坞窗图像已经启动,但是当我去到设置了端口8000的本地主机时,给出一个消息,说明the page is not working ,并且127.0.0.1 didn't send any data

这是docker代码:

 omars-mbp:Split omarjandali$ docker build -t split . Sending build context to Docker daemon 222.2kB Step 1/7 : FROM python:3 ---> 79e1dc9af1c1 Step 2/7 : WORKDIR user ---> 15e014da5b80 Removing intermediate container f4081817276f Step 3/7 : COPY requirements.txt ./ ---> 1f444390862b Step 4/7 : EXPOSE 8000 ---> Running in f75a6674ade2 ---> 7641865ffc85 Removing intermediate container f75a6674ade2 Step 5/7 : RUN pip install -r requirements.txt ---> Running in 40738a20f481 Collecting Django==1.11.5 (from -r requirements.txt (line 1)) Downloading Django-1.11.5-py2.py3-none-any.whl (6.9MB) Collecting gunicorn==19.6.0 (from -r requirements.txt (line 2)) Downloading gunicorn-19.6.0-py2.py3-none-any.whl (114kB) Collecting pytz (from Django==1.11.5->-r requirements.txt (line 1)) Downloading pytz-2017.3-py2.py3-none-any.whl (511kB) Installing collected packages: pytz, Django, gunicorn Successfully installed Django-1.11.5 gunicorn-19.6.0 pytz-2017.3 ---> 371a95617f78 Removing intermediate container 40738a20f481 Step 6/7 : COPY . . ---> fa31f9520063 Step 7/7 : CMD python manage.py runserver 0.0.0.0:8000 ---> Running in 28b6a097dac4 ---> c0d19bca8c2d Removing intermediate container 28b6a097dac4 Successfully built c0d19bca8c2d Successfully tagged split:latest omars-mbp:Split omarjandali$ docker run -d -p 8000:8000 split d70035b14ab0c2046f2bfc8418960a0b1e5dd8bb75e09a045b41e94bcb097aa4 omars-mbp:Split omarjandali$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d70035b14ab0 split "python manage.py ..." 4 seconds ago Up 2 seconds 0.0.0.0:8000->8000/tcp focused_shirley 

docker文件:

 FROM python:3 WORKDIR user COPY requirements.txt ./ EXPOSE 8000 RUN pip install -r requirements.txt COPY . . CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]