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

Simple Docker Image that starts any python server and exposes a certain port

License

Notifications You must be signed in to change notification settings

codeclou-archive/docker-python-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Simple Docker Image that starts any python server and exposes a certain port

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published