title: How to execute cron function in linux alpine using docker
body: <p>I am trying to run my django application using a docker image with a scheduled cron job.</p>
  <p>My Dockerfile is the following</p>
  <pre><code>FROM python:3.8-alpine3.10
  
  WORKDIR /OuterDirectory
  
  ENV PYTHONDONTWRITEBYTECODE 1
  ENV PYTHONUNBUFFERED 1
  ENV PORT=8000
  
  RUN apk update &amp;&amp; apk add --update alpine-sdk
  
  RUN apk add --no-cache tini openrc busybox-initscripts
  
  COPY requirements.txt requirements.txt
  
  RUN pip install --upgrade pip
  RUN pip install -r requirements.txt
  
  RUN apk add --update npm
  
  COPY . /OuterDirectory/
  
  RUN npm install
  RUN mkdir cron
  RUN touch cron/cronlog.log
  WORKDIR /OuterDirectory/Projectname
  
  EXPOSE 8000
  CMD python manage.py crontab add &amp;&amp; python manage.py runserver 0.0.0.0:8000
  </code></pre>
  <p>In django settings I have properly added it to my INSTALLED_APPS.</p>
  <pre><code>CRONJOBS = [
      ('* * * * *', 'api.cron.testfunc', '&gt;&gt; ../cron/cronlog.log 2&gt;&amp;1'),
  ]
  </code></pre>
  <p>Everything in the docker image builds with no error.</p>
  <p>I am 99% sure the issue is something to do with alpine linux and how to configure/get cron running on it but I am unable to find any resources. If anyone has any tips, please do help me I've been trying for a while lol</p>