File size: 547 Bytes
6639e76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

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