Skip to content

Commit

Permalink
fix: cron_scrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
rv2931 committed Feb 28, 2024
1 parent b4740b1 commit a36f402
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions docker-env/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ RUN apt-get install -y rsyslog
WORKDIR /source_code
COPY bloom/ ./bloom/
COPY data/ ./data/
COPY .env.template .
COPY app.py .
COPY container.py .
COPY docker-env/rsyslog.conf /etc/rsyslog.conf
Expand Down Expand Up @@ -44,7 +43,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install -y
# The entrypoint.sh script stores ENV vars at runtime in the ~/.env file as key=value pairs
# Then the cron line include some command to load these ENV vars from file before launching app.py
# This mecanism allows to give access to the same ENV vars for app.py launch in terminal and launch via cron
RUN echo "*/15 * * * * root export \$(cat ~/.env | grep -v '#' | xargs);/venv/bin/python3 /source_code/app.py 2>&1 | /usr/bin/logger -t bloom" >> ./cron_scrapper
RUN echo "*/15 * * * * root export PATH_ENV=/tmp/.env.cron;/venv/bin/python3 -c "from bloom.config import settings";export $(shell cat /tmp/.env.cron| grep -v "#" | xargs -d '\r');/venv/bin/python3 /source_code/app.py 2>&1 | /usr/bin/logger -t bloom" >> ./cron_scrapper
RUN chmod 744 ./cron_scrapper

# Move cron tab into the right directory
Expand Down

0 comments on commit a36f402

Please sign in to comment.