Giter Site home page Giter Site logo

mod_wsgi-docker's Introduction

MOD_WSGI (DOCKER)

The mod_wsgi-docker package is a companion package for Apache/mod_wsgi. It contains configurations for building docker images which bundle up Apache and mod_wsgi-express.

Available images

Prebuilt images available are:

  • grahamdumpleton/mod-wsgi-docker:python-2.7
  • grahamdumpleton/mod-wsgi-docker:python-2.7-onbuild
  • grahamdumpleton/mod-wsgi-docker:python-3.3
  • grahamdumpleton/mod-wsgi-docker:python-3.3-onbuild
  • grahamdumpleton/mod-wsgi-docker:python-3.4
  • grahamdumpleton/mod-wsgi-docker:python-3.4-onbuild
  • grahamdumpleton/mod-wsgi-docker:python-3.5
  • grahamdumpleton/mod-wsgi-docker:python-3.5-onbuild

See mod-wsgi-docker on Docker Hub for more information.

How to use these images

Create a Dockerfile in your Python web application project:

FROM grahamdumpleton/mod-wsgi-docker:python-2.7-onbuild
CMD [ "hello.wsgi" ]

The list of CMD arguments should consist of the path to the WSGI script file for the Python web application and any additional arguments you wish to have supplied to the mod_wsgi-express command.

These 'onbuild' images include multiple ONBUILD triggers, which should be all you need to bootstrap most applications. The build will COPY the current directory into /app and then RUN pip install on any requirements.txt file. It is possible to define pre and post hooks to enable additional system packages to be installed and for additional application setup to be performed.

You can then build and run the Docker image:

docker build -t my-python-app .
docker run -it --rm -p 8000:80 --name my-running-app my-python-app

The Python web application should then be accessible at port 8000 of the docker host.

Note that although your specific Python web application when run will run as the non root user whiskey, the Apache server itself will initially start up as the root user. Some Docker runtime environments however may be set up so as to prohibit you running your container as the root user and require a non root user from the outset.

If this is the case, you can use:

FROM grahamdumpleton/mod-wsgi-docker:python-2.7-onbuild
USER $MOD_WSGI_USER:$MOD_WSGI_GROUP
CMD [ "hello.wsgi" ]

For additional examples see the 'demos' sub directory.

mod_wsgi-docker's People

Contributors

bostrt avatar grahamdumpleton avatar mandarg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.