Python-3.9 alpine linux image with added files used by my standard cronjob scripts
Go to file
2021-03-10 12:13:43 -08:00
app Dockerfile stuff 2021-03-10 11:19:18 -08:00
ssh Dockerfile stuff 2021-03-10 11:19:18 -08:00
.gitignore added gitignore 2021-03-10 12:13:43 -08:00
docker-compose.yml added image name/tag to build 2021-03-10 11:52:41 -08:00
Dockerfile Dockerfile stuff 2021-03-10 11:19:18 -08:00
README.md Update README.md 2021-03-10 11:49:44 -08:00

Python-3.9 Docker Container

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 and docker-compose.

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.