Skip to content

Simple docker image with the latest python 3 completed by Bottle+Requests libraries that serve to run web python apps easily

License

Notifications You must be signed in to change notification settings

Angatar/python_in_bottle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Pulls Docker Image Size Docker build Build status Docker Stars Github Stars Github forks Github open issues Github closed issues GitHub license

python in bottle (d3fk/python_in_bottle)

A simple Python 3 in a docker Alpine linux multi-arch container image completed by Bottle and Requests libraries that serves to run web python apps easily (Total size of the container: Docker Image Size).

Docker image

Pre-build as multi-arch image from Docker hub with "automated build" option.

image name d3fk/python_in_bottle

docker pull d3fk/python_in_bottle

Docker hub repository: https://hub.docker.com/r/d3fk/python_in_bottle/

DockerHub Badge

Image TAGS

This image is provided with 3 TAGS wich are all multi-arch images:

  • d3fk/python_in_bottle:latest: is a multi-arch image that is regularly updated for python 3 and Alpine linux versions including packages & security fixes.
  • d3fk/python_in_bottle:stable: is a multi-arch image with fixed versions, i.e. python 3.11 in an Alpine 3.17. This image had a stable behaviour observed in production, so that it was freezed in a release of the code repo and built from the Docker hub by automated build. It won't be changed or rebuilt in the future (the code is available from the "releases" section of this image code repository on GitHub).
  • d3fk/python_in_bottle:gcc: is a multi-arch image that corresponds to the "latest" image + gcc and libc packages installed for those who need them as build dependencies. It is regularly updated for python 3 and Alpine linux versions including packages & security fixes.

These multi-arch images will fit most of architectures:

  • linux/amd64
  • linux/386
  • linux/arm/v6
  • linux/arm/v7
  • linux/arm64/v8
  • linux/ppc64le
  • linux/s390x

Run it

For example, if you need to run a web app you could use it this way:

docker run -itd -p 80:80 -v $(pwd)/myapp:/usr/src/myapp -w /usr/src/myapp d3fk/python_in_bottle:latest python your-python-script.py

Then go to your browser at http://localhost to see your web app running

Example Script

Here is a small "Hello World" example using the Bottle Web Framework

your-python-script.py

from bottle import route, run

@route('/')
def hello():
    return "Hello World!"

run(host='0.0.0.0', port=80, debug=True)

More info

More details on the Bottle Web Framework here: https://bottlepy.org

More details on the Requests python library here: http://docs.python-requests.org

License

The content of this GitHub code repository is provided under MIT licence GitHub license. For the embeded libraries and packages please see the related licenses information on their respective official repositories.