Dockerfile 944 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. vim \
  6. cron \
  7. tzdata \
  8. calibre \
  9. && rm -rf /var/lib/apt/lists/*
  10. # Create a directory for Calibre library
  11. RUN mkdir -p /calibre/library
  12. # Copy your cron job file into the container
  13. COPY calibre-cron /etc/cron.d/calibre-cron
  14. # Give execution rights to the cron job
  15. RUN chmod 0644 /etc/cron.d/calibre-cron
  16. # Apply the cron job
  17. RUN crontab /etc/cron.d/calibre-cron
  18. # Create the log file (optional, for debugging)
  19. RUN touch /var/log/calibre-cron.log
  20. # Create a directory for custom cron jobs (optional)
  21. RUN mkdir -p /etc/cron.d
  22. # Set the working directory
  23. WORKDIR /calibre
  24. # Copy the entrypoint script into the container
  25. COPY entrypoint.sh /entrypoint.sh
  26. # Make the entrypoint script executable
  27. RUN chmod +x /entrypoint.sh
  28. # Set the entrypoint to the script
  29. ENTRYPOINT ["/entrypoint.sh"]