V1.30.5 set cron
This commit is contained in:
parent
ea28b1a711
commit
83736df898
14
Dockerfile
14
Dockerfile
@ -3,6 +3,19 @@ WORKDIR /aitrainer_backoffice
|
||||
ADD . /aitrainer_backoffice/
|
||||
RUN /usr/local/bin/python -m pip install --upgrade pip
|
||||
RUN apt-get update && apt-get install vim -y
|
||||
RUN apt-get -y install cron
|
||||
# Copy cron file to the cron.d directory
|
||||
COPY aitrainer-cron /etc/cron.d/hello-cron
|
||||
|
||||
# Give execution rights on the cron job
|
||||
RUN chmod 0644 /etc/cron.d/aitrainer-cron
|
||||
|
||||
# Apply cron job
|
||||
RUN crontab /etc/cron.d/aitrainer-cron
|
||||
|
||||
# Create the log file to be able to run tail
|
||||
RUN touch /var/log/cron.log
|
||||
|
||||
RUN pip3 install uwsgi
|
||||
COPY requirements.txt ./
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
@ -10,6 +23,7 @@ RUN pip install --no-cache-dir -r requirements.txt
|
||||
COPY uwsgi_params /var/www/aitrainer.info/
|
||||
COPY .key ./
|
||||
ENV DJANGO_KEY="9ö2345iőjfdsasd9ukjhlkdf9hg"
|
||||
ENV GOOGLE_APPLICATION_CREDENTIALS="/aitrainer_backoffice/aitrainer_backoffice/aitrainer_backoffice/asset/aitrainer-firebase-adminsdk.json"
|
||||
|
||||
ENV PORT=8000
|
||||
EXPOSE 8000
|
||||
|
1
aitrainer-cron
Normal file
1
aitrainer-cron
Normal file
@ -0,0 +1 @@
|
||||
*/30 * * * * python /aitrainer_backoffice_aitrainer_backoffice/manage.py runcrons --settings aitrainer_backoffice.settings.deploy > /var/log/cronjob.log
|
Loading…
Reference in New Issue
Block a user