File size: 1,278 Bytes
74caaae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# --- Development Dockerfile ---
# Use official Python image
FROM python:3.13-slim-bookworm

# Install necessary system libraries for OpenCV and OCR (docling) to run on a slim image
# as well as curl and ca-certificates for uv installation
RUN apt-get update && apt-get install -y --no-install-recommends \
    curl \
    ca-certificates \
    libglib2.0-0 \
    libgl1 \
    libxcb1 \
    libxext6 \
    libsm6 \
    libxrender1 \
    && rm -rf /var/lib/apt/lists/*

# Install uv binary using the standalone installer
ENV UV_INSTALL_DIR="/usr/local/bin"
RUN curl -LsSf https://astral.sh/uv/install.sh | sh

WORKDIR /app

# Configure uv to use the system Python environment and copy mode
ENV UV_PYTHON=python3.13
ENV UV_PYTHON_PREFERENCE=only-system
ENV UV_LINK_MODE=copy

# Copy dependency files
COPY pyproject.toml uv.lock ./

# Install project dependencies (including dev)
RUN --mount=type=cache,target=/root/.cache/uv \
    uv sync --frozen

# Ensure the sqlite database directory exists directly in the container
RUN mkdir -p infrastructure/databases/sqlite

# Set runtime paths
ENV PATH="/app/.venv/bin:$PATH"
ENV PORT=8000
ENV PYTHONUNBUFFERED=1

# Default to fastapi dev command for hot reloading
CMD ["fastapi", "dev", "main.py", "--host", "0.0.0.0", "--port", "8000"]