Skip to content

chrahunt/example-python-docker-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

example-python-docker-service

Example of running a simple Python script in Docker.

docker-compose up
# when changes have been made
docker-compose build && docker-compose up

development

Models for resolving development issues when working on Python docker services.

if package is external to Dockerfile repository

Copy package into directory before doing Docker build, or provide a git URL to the context key in the docker-compose.yml.

if locally-developed packages are used

When doing development on a Dockerized Python application, locally developed packages also need to be available to the app.

Run a local pypiserver and symlink all locally-developed packages into the packages directory. Expose the URL using PIP_EXTRA_INDEX_URL at build-time (by editing the Dockerfile) or at runtime by running an entrypoint script. To always pick up new changes run docker-compose build --no-cache.

production

notification

Provide authorization credentials via Docker secrets to the application, reading the location from environment variables.

logging

Use built-in Docker logging drivers to direct container stderr logs to the desired location.

About

Example of wrapping a Python function in a simple server and deploying using Docker.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages