🚀 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.
-
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: -
Set your environment variables
env
# who crons will run as USER_ID=720 GROUP_ID=720 -
Drop your cron files into the volume
Any file placed in the volume mounted to
/tock/cronsis automatically picked up. You can also mount a scripts directory anywhere (e.g.,/scripts) and reference it from your cron files. -
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