Docker Container that starts a python webapp mounted as volume.
383
Docker-Image to run python webapps mounted as volume.
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
See the example-app and abide the following conventions for your application:
requirements.txt in the root of your project defining your dependenciesapp.py in the root of your project that starts a server on 8000 and listens on 0.0.0.0extlibs dir
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/extlibs/")
Content type
Image
Digest
Size
19 MB
Last updated
over 9 years ago
docker pull codeclou/docker-python-web