Skip to content
This repository was archived by the owner on Sep 3, 2019. It is now read-only.

Latest commit

 

History

History
74 lines (47 loc) · 2.25 KB

File metadata and controls

74 lines (47 loc) · 2.25 KB

docker-python-web

‼️ Deprecated and Discontinued ‼️

Docker-Image to run python webapps mounted as volume.


 

Prerequisites

 


Usage

Run the example-app like so.

docker run \
    -i -t \
    -v $(pwd)/example-app/:/pyapp/web \
    -v $(pwd)/data/:/pyapp/data \
    -p 8877:8000 \
    codeclou/docker-python-web:latest

Now go to http://localhost:8877 and see your app. Note: Depending on how many dependencies you install, it might take some time until the server starts up. You can write to /pyapp/data/* from your application.


Run a commandline app like so

docker run \
    -i -t \
    -v $(pwd)/example-cli/:/pyapp/web \
    -v $(pwd)/data/:/pyapp/data \
    codeclou/docker-python-web:latest \
    python cli.py

 


Application Requirements

See the example-app and abide the following conventions for your application:

  • Have a requirements.txt in the root of your project defining your dependencies
  • Have a app.py in the root of your project that starts a server on 8000 and listens on 0.0.0.0
  • Include the following line in your app to fetch the libs from extlibs dir
    • sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/extlibs/")

 

License, Liability & Support