Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/srittau/docker-cron
Base container for Python cron scripts
https://github.com/srittau/docker-cron
cron docker python
Last synced: about 1 month ago
JSON representation
Base container for Python cron scripts
- Host: GitHub
- URL: https://github.com/srittau/docker-cron
- Owner: srittau
- License: mit
- Created: 2021-08-10T10:47:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-29T19:19:13.000Z (7 months ago)
- Last Synced: 2024-10-03T03:42:48.425Z (about 1 month ago)
- Topics: cron, docker, python
- Language: Shell
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Base container for Python cron scripts
## Installation
One of:
```
docker pull srittau/cron:latest-copy
docker pull srittau/cron:latest-onbuild
```## Usage
There are two variants of the image: `onbuild` and `copy`. The `onbuild`
requires several files in your build directory:* A `crontab` file. A sample crontab is included. Python modules can be run using the `/app/run-module.sh` script.
* A `msmtprc` configuration file. If you don't want to send mail, this file can be empty. A sample file is included.In your `Dockerfile`:
```
FROM srittau/cron:3.11-onbuild
```The `copy` variant requires you to copy your Python modules into the image
yourself. In your `Dockerfile`:```
FROM srittau/cron:3.11-copyCOPY ./crontab /etc/crontab
COPY ./msmtprc /root/.msmtprc
```Copying the .msmtprc file is optional. By default, the image will not send
mail.Your Python modules should be copied into the `/app/src` directory in your
image. You can also copy or mount a environment file to `/app/env`. Shell
variables in this file are added to the environment before running your
scripts.