Run python website on docker

I have created a Python + Flask website on docker. If I do “docker-compose up” the website is available on

I have tagged and pushed the container to docker and I tried doing docker run mydomain/mycontainer from a different computer. It starts downloading everything, but at the end it displays Status: Downloaded newer image for mydomain/mycontainer:latest and nothing happens.

  • How do I create docker image from an existing CentOS?
  • How do I configure which DNS server docker uses in Docker for Mac?
  • Connection refused error with cassandra and docker-py
  • How do I build docker images when my development environment mounts my codebase into the container?
  • Failed to create the host-only adapter - windows 10, docker, virtualbox
  • Replace Docker container with external service
  • I tried doing docker run mydomain/mycontainer python and it displays “Running on” but if I open that URL I get “This website is not available”. I cannot see any processes running on port 5000 either.

    Any ideas?

  • Access to the docker machine from Android app
  • Angular 2 build once, deploy anywhere
  • How does Vagrant automatically install Docker on CentOS?
  • rawmemchr: symbol not found in nodegit with docker
  • Why Docker containers can't communicate with each other?
  • Rails assets fingerprints differ on server
  • 2 Solutions collect form web for “Run python website on docker”

    The ip is the local address inside the docker image. If you want to access it outside the image (ie. locally on your computer), you have to expose the given port. Here is the EXPOSE parameter documentation.

    If you run the command:

    docker run -p 5000:5000 mydomain/mycontainer python

    Your server will be accessible on:


    BTW, I made a public (and open source) Docker image with all the bells and whistles that you can use to build a Python Flask web application.

    It has uWSGI for running the application, Nginx to serve HTTP and Supervisord to control them, so you don’t have to learn how to install and configure all those to build your Python Flask web app.

    It seems like uWSGI with Nginx is one of the more robust (and with great performance) ways to deploy a Python web app. Here are the benchmarks:

    There are even some template projects you can use to bootstrap your own. And also, you don’t have to clone the full project or something, you can just use it as a base image.

    Docker Hub:


    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.