From 18f59d2e0495f489983894255629390b4b878ba3 Mon Sep 17 00:00:00 2001 From: Fred Warren Date: Wed, 10 Mar 2021 11:49:44 -0800 Subject: [PATCH] Update README.md --- README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5f45379..a555eb9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,47 @@ -# Python +# Python-3.9 Docker Container -Python-3.9 alpine linux image with added files used by my standard cronjob scripts +Python-3.9 alpine linux image with added files used by my standard cronjob scripts. Dummy ssh keys are included. Replace in actual project if needed. This container includes ssh, mysql, read/write xls/xlsx and the pudb python debugger. + +This contianer will run the scrpipt named `script.py`. + +How install [docker](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04) and [docker-compose](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-compose-on-ubuntu-20-04). + +## To only Build container +``` +docker-compose Build +``` + +## To Build (if needed) and Run contianer +``` +docker-compose up +``` + +## To Build (if needed) and Run container in background +``` +docker-compose up -d +``` + +## To Run container with command prompt +``` +docker-compose run --entrypoint=/bin/sh python-app +``` + +## To enter running container with command prompt +``` +docker-compose exec --entrypoint=/bin/sh python-app +``` + +## To view container logs +``` +docker-compose logs python-app +``` + +## To monitor container logs (when container started with -d) +``` +docker-compose logs -f python-app +``` + +# Customzing for your own app +Replace the contents of the `app` folder with your python script(s). If the main script is named `script.py` no additonal changes are needed. + +If your script has a different name then modify the last line of `docker-compose.yml` and change `entrypoint` to reference your script.