Example of running a simple Python script in Docker.
docker-compose up
# when changes have been made
docker-compose build && docker-compose upModels for resolving development issues when working on Python docker services.
Copy package into directory before doing Docker build, or provide a git URL
to the context key in the docker-compose.yml.
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.
Provide authorization credentials via Docker secrets to the application, reading the location from environment variables.
Use built-in Docker logging drivers to direct container stderr logs to the desired location.