Public Repository

Last pushed: 3 years ago
Short Description
Sample of using grahamdumpleton/mod-wsgi-docker image
Full Description


Pull from grahamdumpleton/mod-wsgi-docker. For customized Flask deployment.

Usage of grahamdumpleton/mod-wsgi-docker with Flask project

  1. docker pull grahamdumpleton/mod-wsgi-docker
  2. Create a Flask project
  3. Create requirements.txt:flask
  4. Create *.wsgi:

    import sys<br>
    from hello import app as application

  5. Create Dockerfile:

    FROM grahamdumpleton/mod-wsgi-docker:python-x.x-onbuild # onbuild is option<br>
    CMD [ "myapp.wsgi", "requirements.txt" ]

  6. docker build -t myapp .<br> This will copy *.wsgi to /app of image , then download and install the packages designated in requirements.txt, the name myapp will be the name of built image. If you want to push to Dockerhub, it should has prefix of dockerhub id: fbukevin/myapp

  7. docker run -it --rm -p 8000:80 --name container-name myapp
  8. Then browse on browser with 8000 port
Docker Pull Command