在Ubuntu Linux服务器上,我有一个Flask应用程序(有4条路径)作为Docker映像运行。
我的Dockerfile-
FROM ubuntu:18.04
FROM python:3
RUN apt-get update -y && apt-get install -y python-pip python-dev
COPY . /backend
WORKDIR /backend
RUN pip3 install -r requirements.txt
EXPOSE 8000
CMD gunicorn --bind 0.0.0.0:8000 --workers=4 wsgi:app
sudo docker run -it flaskApp:1.16
标准节目
[2020-10-01 14:03:25 +0000] [6] [INFO] Starting gunicorn 20.0.4
[2020-10-01 14:03:25 +0000] [6] [INFO] Listening at: http://0.0.0.0:8000 (6)
[2020-10-01 14:03:25 +0000] [6] [INFO] Using worker: sync
[2020-10-01 14:03:25 +0000] [8] [INFO] Booting worker with pid: 8
[2020-10-01 14:03:25 +0000] [9] [INFO] Booting worker with pid: 9
[2020-10-01 14:03:25 +0000] [10] [INFO] Booting worker with pid: 10
[2020-10-01 14:03:25 +0000] [11] [INFO] Booting worker with pid: 11
但是当我使用服务器的公共IP访问应用程序和API时,它无法连接。
-
-
我的Dockerfile正确吗?