updated mail Dockerfile with env variables

This commit is contained in:
berkay 2025-04-25 15:03:47 +03:00
parent b9825bb8e8
commit 9f0c42e57a
1 changed files with 7 additions and 1 deletions

View File

@ -14,8 +14,14 @@ RUN poetry config virtualenvs.create false && poetry install --no-interaction --
# Install cron for scheduling tasks
RUN apt-get update && apt-get install -y cron
# Create a script to export environment variables and run the app
RUN echo '#!/bin/bash' > /run_app.sh && \
echo 'export $(printenv | grep EMAIL_ | xargs)' >> /run_app.sh && \
echo '/usr/local/bin/python /app.py' >> /run_app.sh && \
chmod +x /run_app.sh
# 11:00 Istanbul Time (UTC+3) system time is 08:00 UTC
RUN echo "0 8 * * * /usr/local/bin/python /app.py >> /var/log/cron.log 2>&1" > /tmp/crontab_list && crontab /tmp/crontab_list
RUN echo "0 8 * * * /run_app.sh >> /var/log/cron.log 2>&1" > /tmp/crontab_list && crontab /tmp/crontab_list
# Copy application code
COPY /BankServices/RoutineEmailService /