I have created a python application using flask module and tested it locally and it is working fine. So i have tried to deploy it using a ubuntu docker container, but now the application is not loading from browser.

sudo docker run -d -p 5000:5000 --name p-email-ubuntu-cont app-ubuntu-img

tried loading localhost:5000 and ContainerIP:5000 but none of this is not loading.


FROM ubuntu
RUN apt-get update 
RUN apt-get install -y python 
RUN apt-get install -y python-pip
RUN pip install flask
RUN pip install requests
COPY MANAGE/ /home/deployment/
WORKDIR /home/deployment
CMD python ./manage.py

Any suggesions?

1 Answer 1


Well a lot of things here the order of troubleshooting that I follow could be

  1. Don't run your container in detach mode at least for your troubleshooting process (the -d switch)
  2. Try to launch your container in interactive mode to see if you have some exception in your code or python installation using "docker run -i -t"
  3. Run a bash session in your container "sudo docker exec -i -t app-ubuntu-img /bin/bash" whit the bash session try to run your code and see what happens
  • Thanks for checking this. Issue got fixed. The issue was with host part mentioned in python code. I have changed from localhost to host=""
    – Sreejith
    Commented Oct 18, 2018 at 20:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .