Run crontab in docker. Django

448
September 15, 2017, at 00:39 AM

Sorry for my english. I created docker file. For cron task i user this library, In my local test all work, but now i try use docker and try run cron there.But now i have error

no crontab for root

My docker file:

FROM python:3.6
WORKDIR /usr/src/app
COPY requirements.txt ./
RUN apt-get update && apt-get install -y cron
RUN pip install -r requirements.txt
COPY . .
EXPOSE 8000
CMD python manage.py runserver 0.0.0.0:8000
RUN python manage.py crontab add
RUN python manage.py crontab show

My requirements

Django==1.11.4
django-filter==1.0.4
djangorestframework
Pillow
django-crontab
Answer 1

Perhaps django-crontab expects the crontab to exist before adding stuff. You can try to create a new crontab for root first.

RUN crontab <<< '# new crontab'
RUN python manage.py crontab add
RUN python manage.py crontab show
Rent Charter Buses Company
READ ALSO
Query only the parent class in SQLAlchemy joined table inheritance

Query only the parent class in SQLAlchemy joined table inheritance

I have a parent class that represents a standard model in the software

284
SQLAlchemy generates its own primary keys?

SQLAlchemy generates its own primary keys?

I've started integrating SQLAlchemy into my app, to work with HP Vertica databaseBasic functionality worked fine so far, but something very weird happens now:

314
Python randomly crashes when using theano

Python randomly crashes when using theano

I am new to python and try to use lasagne and theano to enhance performance of machine learning by computing it on GPU (installed numpy+mlk)I call NeuralNet

323
Web Scraping with Python different with .children and .descendants

Web Scraping with Python different with .children and .descendants

The book tell thatchildren will not include tag like img, span and td, but it print all of them, why?

296