From 59441e00cbfb69ae84b14bc2b8444b215a7b1c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Fabr=C3=A9gat?= Date: Thu, 19 Dec 2024 17:57:47 -0800 Subject: [PATCH] fix --- .dockerignore | 2 ++ Dockerfile | 16 +++++++--------- app.py | 1 - requirements.txt | 1 - 4 files changed, 9 insertions(+), 11 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fc1760d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +/.git* +/docker-compose.yaml diff --git a/Dockerfile b/Dockerfile index 599f224..a3a7117 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,19 +4,17 @@ ARG PORT=5000 ENV debian_frontend=noninteractive ENV PYTHONUNBUFFERED=1 +# Set the working directory in the container WORKDIR /app -RUN apt-get update && apt-get install -y \ - libmagic1 \ - && rm -rf /var/lib/apt/lists/* +# Copy the source code to the container +COPY . . -COPY requirements.txt . +# Install dependencies +RUN pip install --upgrade pip && \ + pip install --no-cache-dir -r requirements.txt -RUN pip install --no-cache-dir -r requirements.txt - -COPY app.py . -COPY entrypoint.sh . +# Run the application RUN chmod +x entrypoint.sh - EXPOSE $PORT ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/app.py b/app.py index a5a4cff..94796db 100644 --- a/app.py +++ b/app.py @@ -18,7 +18,6 @@ async def health(): return JSONResponse(content={"status": "up", "timestamp": datetime.now().isoformat()}) - @app.post("/extract", response_model=ExtractResponse) async def extract(file: UploadFile = File(...)): if file.content_type != "application/pdf": diff --git a/requirements.txt b/requirements.txt index c3f06ad..e0fabd1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,5 @@ pydantic_core==2.27.2 PyMuPDF==1.25.1 python-multipart==0.0.20 sniffio==1.3.1 -starlette==0.42.0 typing_extensions==4.12.2 uvicorn==0.34.0