Hi I have made my flask app and I have exposed port 5001 in Docker file. I pushed it to dockerhub repo and ran on different machine by
docker container run --name XYZ <username>/<repo_name>:<tag>
The log says that app is running on http://127.0.0.1:5001/
But if I open that localtion in browser its says
Unable to connect
Dockerfile:
FROM ubuntu:18.04
RUN apt-get update && apt-get -y upgrade \
&& apt-get -y install python3.8 \
&& apt -y install python3-pip \
&& pip3 install --upgrade pip
WORKDIR /app
COPY . /app
RUN pip3 --no-cache-dir install -r requirements.txt
EXPOSE 5001
ENTRYPOINT ["python3"]
CMD ["app.py"]