Add in CronJob to update the Financial Data every 2 days

This commit is contained in:
2026-02-16 16:37:35 -08:00
parent 56760f9dff
commit 37687b64c7
5 changed files with 52 additions and 22 deletions
+16 -1
View File
@@ -37,6 +37,7 @@ RUN apt update && apt upgrade -y && apt install -y \
libbz2-dev \
wget \
ca-certificates \
cron \
&& rm -rf /var/lib/apt/lists/*
# Download, extract, configure, and compile python 3.11
@@ -77,5 +78,19 @@ EXPOSE 5000
# Copy in the webserver
COPY --from=build-Webserver /app/publish ./
# Copy in cronjob
COPY crontab.txt /etc/cron.d/reload-finance-history
# Copy in EntryPoint
COPY entrypoint.sh /entrypoint.sh
# Give execution rights on the cronjob and entrypoint
RUN chmod 0644 /etc/cron.d/reload-finance-history && \
chmod +x /entrypoint.sh && \
touch /var/log/cron.log
# Apply the cron job
RUN crontab /etc/cron.d/reload-finance-history
# Start the container
ENTRYPOINT ["dotnet", "WebServer.dll", "--url", "http://localhost:5000"]
ENTRYPOINT ["/entrypoint.sh"]