I am junior developer and I am struggling with my current task at work. I need to run a script with cron inside a docker container and I am a little lost. My script is check.py, my DOCKERFILE is :
FROM ubuntu:latest
# Set the working directory to /app
WORKDIR /monitor-updates
# Copy the current directory contents into the container at /app
ADD . /monitor-updates
RUN \
apt-get update && \
apt-get install -y python python-dev python-pip python-virtualenv libmysqlclient-dev curl&& \
rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
ADD my-crontab /
ADD check.py /
RUN chmod a+x check.py
RUN chmod a+x my-crontab
RUN my-crontab
CMD ["cron", "-f"]
and my cron file is my-crontab:
* * * * * /check.py > /dev/console