Skip to content

wood-brandon/Docker_Python_Cron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Docker_Python_Cron

A quickstart recipe for running a Python script on a cron job inside a docker container.

Usage

  1. Replace src/script.py with your Python file.
  2. Add any requirements for the Python script in /src/requirements.txt.
  3. Replace src/crontab/ with your desired cron (see https://crontab.guru/).
  4. In the root directory, run
    • docker build -t IMAGE_NAME .
    • docker run -d --name CONTAINER_NAME IMAGE_NAME (including any other arguments you might need e.g. environment variables)

Ensure src/script.py and src/crontab have Unix line endings. For further CRON debugging see this post

About

A quick-start setup for running a Python script on a cron inside a docker container.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published