FROM python:3.9-slim-buster WORKDIR /app # Install cron RUN apt-get update && apt-get install -y cron # Copy application files COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY . . # Give execution rights to the script RUN chmod +x gpu_info_collector.sh COPY crontab_job /etc/cron.d/crontab_job # Give execution rights on the cron job RUN chmod 0644 /etc/cron.d/crontab_job # Apply cron job RUN crontab /etc/cron.d/crontab_job # Start cron in the background and run the Python app CMD cron && python app.py