changed to uv fo managing dependencies

This commit is contained in:
2025-07-26 12:41:15 +02:00
parent 96b0718081
commit e2a918112b
4 changed files with 1409 additions and 5 deletions

View File

@@ -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
COPY Pipfile Pipfile.lock .
RUN pip install pipenv
RUN pipenv install --deploy --system
# Copy uv files
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
EXPOSE 8000
@@ -17,4 +35,4 @@ ENV MEMCACHED_HOST_PATH=none
ENV LOKI_URL=none
# 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