Python-3.9 alpine linux image with added files used by my standard cronjob scripts
app | ||
ssh | ||
.gitignore | ||
docker-compose.yml | ||
Dockerfile | ||
README.md |
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.