Tock

Cron in-a-box. A lightweight Docker image that runs your cron jobs with zero fuss.

🚀 Get Started in Minutes

Tock is the simplest way to run cron jobs inside a Docker container. Mount your cron files, set a user, and go.

  1. Create your Docker Compose file
    yaml
    services:
      tock:
        container_name: tock
        image: digitaladapt/tock
        init: true
        restart: unless-stopped
        env_file:
          - .env
        volumes:
          - tock-crons:/tock/crons
    
    volumes:
      tock-crons:
  2. Set your environment variables
    env
    # who crons will run as
    USER_ID=720
    GROUP_ID=720
  3. Drop your cron files into the volume

    Any file placed in the volume mounted to /tock/crons is automatically picked up. You can also mount a scripts directory anywhere (e.g., /scripts) and reference it from your cron files.

  4. Launch it
    bash
    docker compose up -d

Features

📦

Lightweight

Built on Alpine Linux for a tiny footprint and fast startup.

🔧

Configurable User

Set USER_ID and GROUP_ID to control which user runs your cron jobs.

❤️

Health Checks

Built-in Docker health check ensures cron is always running.

🐳

Docker Native

Designed for Docker Compose with volume mounts and environment files.

📋 Example Cron File

A simple cron file that runs every minute:

cron
# /tock/crons/my-job
* * * * * echo "Hello from Tock!" >> /var/log/cron.log