#!/bin/sh -x

# hack needed for Boreas and Medus only else cronjob do not fire
# this hack should still work for other deployments
# remove if cause problem with newer version of canarieapi
touch /etc/cron.d/canarieapi-cron

pip install requests-cache

# chain existing cmd
exec /bin/sh -c "\
  env >> /etc/environment && \
  cron && \
  nginx && \
  gunicorn -b 0.0.0.0:2000 --workers 1 --log-level=DEBUG --timeout 30 -k gevent canarieapi.wsgi \
"
