diff --git a/auth/.dockerignore b/auth/.dockerignore index 72546c82..3039cf4c 100644 --- a/auth/.dockerignore +++ b/auth/.dockerignore @@ -8,5 +8,3 @@ Dockerfile* dbc/ # genereated via swag docs/ - -# vim: ft=gitignore diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 8ca92d13..d0cfb7ac 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -100,9 +100,12 @@ services: condition: service_healthy env_file: - ./.env + ports: + - "4389:4389" environment: - KYOO_URL=${KYOO_URL:-http://api:3567/api} volumes: + - ./scanner:/app - ${LIBRARY_ROOT}:/video:ro transcoder: diff --git a/scanner/.dockerignore b/scanner/.dockerignore index e136516d..9eb2c888 100644 --- a/scanner/.dockerignore +++ b/scanner/.dockerignore @@ -1,2 +1,5 @@ -Dockerfile* +** +!/requirements.txt +!scanner/**.py + diff --git a/scanner/Dockerfile b/scanner/Dockerfile index 9a30c7ea..bfd8b867 100644 --- a/scanner/Dockerfile +++ b/scanner/Dockerfile @@ -6,4 +6,4 @@ RUN pip3 install --no-cache-dir --upgrade -r ./requirements.txt COPY . . -CMD ["fastapi", "run", "scanner/main.py", "--port", "80"] +CMD ["fastapi", "run", "scanner", "--port", "4389"] diff --git a/scanner/Dockerfile.dev b/scanner/Dockerfile.dev index 5b63216c..221b698f 100644 --- a/scanner/Dockerfile.dev +++ b/scanner/Dockerfile.dev @@ -4,4 +4,4 @@ WORKDIR /app COPY ./requirements.txt . RUN pip3 install --no-cache-dir --upgrade -r ./requirements.txt -CMD ["fastapi", "dev", "scanner/main.py", "--port", "80"] +CMD ["fastapi", "dev", "scanner", "--host", "0.0.0.0", "--port", "4389"] diff --git a/scanner/requirements.txt b/scanner/requirements.txt index 25089dc5..717b6581 100644 --- a/scanner/requirements.txt +++ b/scanner/requirements.txt @@ -1,4 +1,6 @@ guessit@git+https://github.com/zoriya/guessit +fastapi[standard] + aiohttp jsons watchfiles diff --git a/scanner/scanner/__init__.py b/scanner/scanner/__init__.py new file mode 100644 index 00000000..48019fd2 --- /dev/null +++ b/scanner/scanner/__init__.py @@ -0,0 +1,8 @@ +from fastapi import FastAPI + +app = FastAPI() + + +@app.get("/items/{item_id}") +async def read_item(item_id): + return {"item_id": item_id} diff --git a/scanner/scanner/main.py b/scanner/scanner/main.py deleted file mode 100644 index ee60be1f..00000000 --- a/scanner/scanner/main.py +++ /dev/null @@ -1,8 +0,0 @@ -from fastapi import FastAPI - -app = FastAPI() - - -@app.get("/") -async def root(): - return {"message": "Hello World"} diff --git a/scanner/shell.nix b/scanner/shell.nix index 6f2147ff..8305e1bb 100644 --- a/scanner/shell.nix +++ b/scanner/shell.nix @@ -1,6 +1,7 @@ {pkgs ? import {}}: let - python = pkgs.python312.withPackages (ps: + python = pkgs.python313.withPackages (ps: with ps; [ + fastapi guessit aiohttp jsons @@ -17,5 +18,6 @@ in packages = with pkgs; [ python ruff + fastapi-cli ]; }