Skip to content

Instantly share code, notes, and snippets.

@x-yuri
Last active February 5, 2023 05:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save x-yuri/66fc314d2e38395ff5778398c233e017 to your computer and use it in GitHub Desktop.
Save x-yuri/66fc314d2e38395ff5778398c233e017 to your computer and use it in GitHub Desktop.
docker + yacron

docker + yacron

Use -l LOG_LEVEL to make it more verbose. The log levels are:

  • CRITICAL
  • ERROR
  • WARNING
  • INFO
  • DEBUG

docker-compose.yml:

services:
  yacron:
    build: .
    command: /home/app/.local/bin/yacron -c crontab.yaml

Dockerfile:

FROM alpine:3.17
RUN set -x \
    && apk add --no-cache python3 py3-pip shadow \
    && useradd -m app
USER app
RUN pip install 'yacron<1'
COPY crontab.yaml .

crontab.yaml:

jobs:
  - name: a
    command: date
    schedule: '* * * * *'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment