mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-02-02 17:59:27 +08:00
Update Dockerfile, Fix bugs
This commit is contained in:
4
.github/workflows/dev-latest.yml
vendored
4
.github/workflows/dev-latest.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
- name: Create Version info
|
||||
run: |
|
||||
echo "version='2.6.0'" > module/conf/version.py
|
||||
echo "VERSION = '2.6.0-beta'" > module/conf/version.py
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -30,5 +30,5 @@ jobs:
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
push: true
|
||||
tags: estrellaxd/auto_bangumi:dev-latest
|
||||
tags: estrellaxd/auto_bangumi:2.6.0-beta2
|
||||
file: ./Dockerfile
|
||||
|
||||
20
Dockerfile
20
Dockerfile
@@ -1,9 +1,17 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM python:3.11-buster AS build
|
||||
FROM python:3.11-alpine AS build
|
||||
|
||||
RUN mkdir /install
|
||||
WORKDIR /install
|
||||
COPY requirements.txt .
|
||||
|
||||
RUN apk update \
|
||||
&& apk add --no-cache \
|
||||
curl \
|
||||
gcc \
|
||||
g++ \
|
||||
linux-headers \
|
||||
|
||||
RUN python3 -m pip install --upgrade pip \
|
||||
&& pip install -r requirements.txt --prefix="/install"
|
||||
|
||||
@@ -14,10 +22,10 @@ ENV TZ=Asia/Shanghai \
|
||||
PGID=1000 \
|
||||
UMASK=022
|
||||
|
||||
WORKDIR /
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build --chmod=777 /install /usr/local
|
||||
COPY --chmod=755 . .
|
||||
COPY --chmod=755 . /app
|
||||
|
||||
RUN apk add --no-cache \
|
||||
curl \
|
||||
@@ -33,13 +41,13 @@ RUN wget "https://github.com/Rewrite0/Auto_Bangumi_WebUI/releases/download/$(cur
|
||||
RUN addgroup -S auto_bangumi -g 1000 && \
|
||||
adduser -S auto_bangumi -G auto_bangumi -h /home/auto_bangumi -u 1000 && \
|
||||
usermod -s /bin/bash auto_bangumi && \
|
||||
mkdir -p "/config" && \
|
||||
mkdir -p "/data" && \
|
||||
mkdir -p "config" && \
|
||||
mkdir -p "data" && \
|
||||
chmod a+x \
|
||||
run.sh
|
||||
|
||||
EXPOSE 7892
|
||||
|
||||
VOLUME [ "/config" , "/data"]
|
||||
VOLUME [ "config" , "data"]
|
||||
|
||||
CMD ["sh", "run.sh"]
|
||||
|
||||
@@ -4,12 +4,12 @@ from fastapi import FastAPI, Request
|
||||
from fastapi.responses import HTMLResponse, FileResponse
|
||||
from fastapi.templating import Jinja2Templates
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from pydantic import BaseModel
|
||||
import logging
|
||||
|
||||
from .core import APIProcess
|
||||
from .conf import settings, DATA_PATH, LOG_PATH
|
||||
from .utils import json_config
|
||||
from .models.api import *
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -47,10 +47,6 @@ def remove_rule(bangumi_title: str):
|
||||
return api_func.remove_rule(bangumi_title)
|
||||
|
||||
|
||||
class RssLink(BaseModel):
|
||||
rss_link: str
|
||||
|
||||
|
||||
@app.post("/api/v1/collection")
|
||||
async def collection(link: RssLink):
|
||||
return api_func.download_collection(link.rss_link)
|
||||
@@ -61,11 +57,6 @@ async def subscribe(link: RssLink):
|
||||
return api_func.add_subscribe(link.rss_link)
|
||||
|
||||
|
||||
class AddRule(BaseModel):
|
||||
title: str
|
||||
season: int
|
||||
|
||||
|
||||
@app.post("/api/v1/addRule")
|
||||
async def add_rule(info: AddRule):
|
||||
return api_func.add_rule(info.title, info.season)
|
||||
@@ -76,6 +67,4 @@ def run():
|
||||
uvicorn.run(app, host="0.0.0.0", port=settings.program.webui_port)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run()
|
||||
|
||||
|
||||
@@ -87,6 +87,3 @@ def run():
|
||||
bangumi_data = load_data_file()
|
||||
# 主程序循环
|
||||
main_process(bangumi_data, download_client)
|
||||
|
||||
if __name__ == '__main__':
|
||||
run()
|
||||
0
module/models/__init__.py
Normal file
0
module/models/__init__.py
Normal file
18
module/models/api.py
Normal file
18
module/models/api.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class RssLink(BaseModel):
|
||||
rss_link: str
|
||||
|
||||
|
||||
class AddRule(BaseModel):
|
||||
title: str
|
||||
season: int
|
||||
|
||||
|
||||
class ChangeConfig(BaseModel):
|
||||
config: dict
|
||||
|
||||
|
||||
class ChangeRule(BaseModel):
|
||||
rule: dict
|
||||
14
module/models/bangumi.py
Normal file
14
module/models/bangumi.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass
|
||||
class MatchRule:
|
||||
keyword: str
|
||||
filter: list
|
||||
rss_link: str
|
||||
|
||||
|
||||
class GroupFilter:
|
||||
name: str
|
||||
filter: list
|
||||
|
||||
Reference in New Issue
Block a user