Dockerfile 668 B

1234567891011121314151617181920212223242526272829
  1. # Use the official Ubuntu as the base image
  2. FROM ubuntu:latest
  3. # Install dependencies
  4. RUN apt-get update && apt-get install -y \
  5. cron \
  6. calibre \
  7. && rm -rf /var/lib/apt/lists/*
  8. # Create a directory for Calibre library
  9. RUN mkdir -p /calibre/library
  10. # Copy your cron job file into the container
  11. COPY crontab /etc/cron.d/calibre-cron
  12. # Give execution rights to the cron job
  13. RUN chmod 0644 /etc/cron.d/calibre-cron
  14. # Apply the cron job
  15. RUN crontab /etc/cron.d/calibre-cron
  16. # Create the log file (optional, for debugging)
  17. RUN touch /var/log/calibre-cron.log
  18. # Set the working directory
  19. WORKDIR /calibre
  20. # Start cron in the foreground
  21. CMD ["cron", "-f"]