diff options
-rw-r--r-- | .github/workflows/docker-image.yml | 49 | ||||
-rw-r--r-- | Dockerfile | 7 | ||||
-rw-r--r-- | README.md | 5 | ||||
-rw-r--r-- | docker-compose.yml | 10 | ||||
-rw-r--r-- | main.py | 8 | ||||
-rw-r--r-- | requirements.txt | 3 |
6 files changed, 80 insertions, 2 deletions
diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..170b284 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,49 @@ +name: miniflux_ai docker image + +on: + release: + types: [ published ] + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - name: Check out the repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }} + tags: | + type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }} + type=pep440,pattern={{raw}},enable=${{ startsWith(github.ref, 'refs/tags/') }} + + + - name: Build and push Docker image + id: push + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}
\ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e06e4ab --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM python:3.9-alpine +LABEL authors="qetesh" +WORKDIR /app +COPY requirements.txt ./ +RUN pip3 install --no-cache-dir -r requirements.txt +COPY . . +CMD [ "python3","-u","main.py" ]
\ No newline at end of file @@ -1,2 +1,7 @@ # miniflux-ai Miniflux with AI + + +## Todo + - [ ] i18n + - [ ] Modular Expansion
\ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..f6058a4 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: '3.3' +services: + miniflux_ai: + container_name: miniflux_ai + image: ghcr.io/qetesh/miniflux_ai:latest + restart: always + environment: + TZ: Asia/Shanghai + env_file: + - .env
\ No newline at end of file @@ -1,4 +1,6 @@ import os +import time + from openai import OpenAI import miniflux from markdownify import markdownify as md @@ -85,5 +87,7 @@ def process_entry(entry): miniflux_client.update_entry(entry['id'], content='摘要:' + llm_result + '<hr><br />' + entry['content']) return None -with concurrent.futures.ThreadPoolExecutor() as executor: - futures = [executor.submit(process_entry, i) for i in entries['entries']]
\ No newline at end of file +while True: + with concurrent.futures.ThreadPoolExecutor() as executor: + futures = [executor.submit(process_entry, i) for i in entries['entries']] + time.sleep(60)
\ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..dff3612 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +miniflux~=1.0.1 +openai~=1.40.3 +markdownify~=0.13.1
\ No newline at end of file |