changed to uv fo managing dependencies
This commit is contained in:
1
backend/.python-version
Normal file
1
backend/.python-version
Normal file
@@ -0,0 +1 @@
|
|||||||
|
3.12.9
|
@@ -1,11 +1,29 @@
|
|||||||
FROM python:3.11-slim
|
FROM python:3.12-slim-bookworm
|
||||||
|
|
||||||
|
# The installer requires curl (and certificates) to download the release archive
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates
|
||||||
|
|
||||||
|
# Download the latest installer
|
||||||
|
ADD https://astral.sh/uv/install.sh /uv-installer.sh
|
||||||
|
|
||||||
|
# Run the installer then remove it
|
||||||
|
RUN sh /uv-installer.sh && rm /uv-installer.sh
|
||||||
|
|
||||||
|
# Ensure the installed binary is on the `PATH`
|
||||||
|
ENV PATH="/root/.local/bin/:$PATH"
|
||||||
|
|
||||||
|
# Set the working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY Pipfile Pipfile.lock .
|
|
||||||
|
|
||||||
RUN pip install pipenv
|
# Copy uv files
|
||||||
RUN pipenv install --deploy --system
|
COPY pyproject.toml pyproject.toml
|
||||||
|
COPY uv.lock uv.lock
|
||||||
|
COPY .python-version .python-version
|
||||||
|
|
||||||
|
# Sync the venv
|
||||||
|
RUN uv sync --frozen --no-cache
|
||||||
|
|
||||||
|
# Copy application files
|
||||||
COPY src src
|
COPY src src
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
@@ -17,4 +35,4 @@ ENV MEMCACHED_HOST_PATH=none
|
|||||||
ENV LOKI_URL=none
|
ENV LOKI_URL=none
|
||||||
|
|
||||||
# explicitly use a string instead of an argument list to force a shell and variable expansion
|
# explicitly use a string instead of an argument list to force a shell and variable expansion
|
||||||
CMD fastapi run src/main.py --port 8000 --workers $NUM_WORKERS
|
CMD uv run fastapi run src/main.py --port 8000 --workers $NUM_WORKERS
|
||||||
|
55
backend/pyproject.toml
Normal file
55
backend/pyproject.toml
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
[project]
|
||||||
|
name = "backend"
|
||||||
|
version = "0.1.0"
|
||||||
|
description = "Add your description here"
|
||||||
|
readme = "README.md"
|
||||||
|
requires-python = ">=3.12"
|
||||||
|
dependencies = [
|
||||||
|
"annotated-types==0.7.0 ; python_full_version >= '3.8'",
|
||||||
|
"anyio==4.8.0 ; python_full_version >= '3.9'",
|
||||||
|
"certifi==2024.12.14 ; python_full_version >= '3.6'",
|
||||||
|
"charset-normalizer==3.4.1 ; python_full_version >= '3.7'",
|
||||||
|
"click==8.1.8 ; python_full_version >= '3.7'",
|
||||||
|
"fastapi==0.115.7 ; python_full_version >= '3.8'",
|
||||||
|
"fastapi-cli==0.0.7 ; python_full_version >= '3.8'",
|
||||||
|
"h11==0.14.0 ; python_full_version >= '3.7'",
|
||||||
|
"httptools==0.6.4",
|
||||||
|
"idna==3.10 ; python_full_version >= '3.6'",
|
||||||
|
"joblib==1.4.2 ; python_full_version >= '3.8'",
|
||||||
|
"loki-logger-handler==1.1.0 ; python_full_version >= '2.7'",
|
||||||
|
"markdown-it-py==3.0.0 ; python_full_version >= '3.8'",
|
||||||
|
"mdurl==0.1.2 ; python_full_version >= '3.7'",
|
||||||
|
"numpy==2.2.2 ; python_full_version >= '3.10'",
|
||||||
|
"pulp==2.9.0 ; python_full_version >= '3.7'",
|
||||||
|
"pydantic==2.10.6 ; python_full_version >= '3.8'",
|
||||||
|
"pydantic-core==2.27.2 ; python_full_version >= '3.8'",
|
||||||
|
"pygments==2.19.1 ; python_full_version >= '3.8'",
|
||||||
|
"pymemcache==4.0.0 ; python_full_version >= '3.7'",
|
||||||
|
"python-dotenv==1.0.1",
|
||||||
|
"pyyaml==6.0.2",
|
||||||
|
"requests==2.32.3 ; python_full_version >= '3.8'",
|
||||||
|
"rich==13.9.4 ; python_full_version >= '3.8'",
|
||||||
|
"rich-toolkit==0.13.2 ; python_full_version >= '3.8'",
|
||||||
|
"scikit-learn==1.6.1 ; python_full_version >= '3.9'",
|
||||||
|
"scipy==1.15.1 ; python_full_version >= '3.10'",
|
||||||
|
"shapely==2.0.6 ; python_full_version >= '3.7'",
|
||||||
|
"shellingham==1.5.4 ; python_full_version >= '3.7'",
|
||||||
|
"sniffio==1.3.1 ; python_full_version >= '3.7'",
|
||||||
|
"starlette==0.45.3 ; python_full_version >= '3.9'",
|
||||||
|
"threadpoolctl==3.5.0 ; python_full_version >= '3.8'",
|
||||||
|
"typer==0.15.1 ; python_full_version >= '3.7'",
|
||||||
|
"typing-extensions==4.12.2 ; python_full_version >= '3.8'",
|
||||||
|
"urllib3==2.3.0 ; python_full_version >= '3.9'",
|
||||||
|
"uvicorn[standard]==0.34.0 ; python_full_version >= '3.9'",
|
||||||
|
"uvloop==0.21.0",
|
||||||
|
"watchfiles==1.0.4",
|
||||||
|
"websockets==14.2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[dependency-groups]
|
||||||
|
dev = [
|
||||||
|
"httpx>=0.28.1",
|
||||||
|
"ipykernel>=6.30.0",
|
||||||
|
"pytest>=8.4.1",
|
||||||
|
"pytest-html>=4.1.1",
|
||||||
|
]
|
1330
backend/uv.lock
generated
Normal file
1330
backend/uv.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user