Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

google/python-runtime

google/python-runtime is a docker base image for easily running Python application.

It is based on google/python base image.

Usage

  • Create a Dockerfile in your python application directory with the following content:

      FROM google/python-runtime
    
  • Run the following command in your application directory:

      docker build -t my/app .
    

Notes

  • Your application sources are copied into the /app directory.
  • A virtualenv with your dependencies is created under the /env directory.

Notes

The image assumes that your application:

  • has a requirements.txt file to specify its dependencies
  • listens on port 8080
  • either has a main.py script as entrypoint or defines ENTRYPOINT ["/env/bin/python", "/app/some_other_file.py"] in its Dockerfile

When building your application docker image, dependencies of your application are automatically fetched in a virtualenv using pip install.