Add in CronJob to update the Financial Data every 2 days
This commit is contained in:
+16
-1
@@ -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"]
|
||||
Reference in New Issue
Block a user