updated Dockerfile

This commit is contained in:
2025-04-25 15:22:20 +03:00
parent 9f0c42e57a
commit 7efd6f8941
2 changed files with 18 additions and 8 deletions

View File

@@ -14,18 +14,15 @@ 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
# Copy application code
COPY /BankServices/RoutineEmailService /
# Make run_app.sh executable
RUN chmod +x /run_app.sh
# 11:00 Istanbul Time (UTC+3) system time is 08:00 UTC
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 /
COPY /Schemas /Schemas
COPY /Controllers /Controllers
COPY /BankServices/ServiceDepends /