I'm new to Docker and trying to put my python application into a image to share with a co-worker. I could build it and could run (below is the application output), but I can't access it from browser.
Here is the Dockerfile:
FROM larsklitzke/mysql-python3.5:latest
RUN mkdir /home/app
COPY . /home/app
RUN pip install boto3
RUN pip install -U flask
RUN pip install requests
RUN pip install Cython
RUN pip install numpy
RUN pip install pandas
WORKDIR /home/app/src
CMD ["python", "/home/app/src/app_web.py"]
I have built the image with the following command: docker build -t leonardo/python-app
.
Then I ran the application using docker run -p 5000:5000 --name app leonardo/python-app
which generate the following output:
* Serving Flask app "app_web" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 200-336-459
Nothing happens when I try to access the application with http://127.0.0.1:5000/
.
When I ran docker network ls
, there were 3 networks. One of them shows the container node pointing to my application, and it is a different IP address (172.17.0.2).
But also does not work with this IP.
What is wrong with my setup?