From ea85ea20ec8b50459f0781153d2a9b4d46d6f255 Mon Sep 17 00:00:00 2001 From: vanten-s Date: Sat, 12 Aug 2023 22:54:12 +0200 Subject: [PATCH] DONE --- Dockerfile | 11 +++++++++++ pull.py | 8 ++++++++ 2 files changed, 19 insertions(+) create mode 100644 pull.py diff --git a/Dockerfile b/Dockerfile index 2601e9f..1584819 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,11 +5,22 @@ FROM python:3.11-alpine # Set working dir WORKDIR /code +# Download git RUN apk add git + +# Download files RUN git clone https://forgejo.vanten-s.com/vanten-s/vanten-s.com . RUN git submodule update --init +# Get latest feeds +RUN git -C feed_articles pull origin main + +# Install requirements RUN pip3 install -r requirements.txt +# Allow us to access the server +EXPOSE 3000 + +# Run CMD ["python3", "main.py", "&"] diff --git a/pull.py b/pull.py new file mode 100644 index 0000000..ef931c6 --- /dev/null +++ b/pull.py @@ -0,0 +1,8 @@ +import os +import time +os.chdir("feed_articles") + +while True: + time.sleep(100) + os.system("git pull") +