Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 24 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,39 @@
FROM python:3.11-slim

# Install system dependencies
# 1. Install system dependencies for Levenshtein/thefuzz
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

# 1. Copy pyproject.toml AND the source code first
# Pip needs the 'src' directory to exist to complete the installation
COPY apps/api/pyproject.toml /app/pyproject.toml
COPY apps/api/src /app/src
RUN touch /app/README.md

# 2. Install dependencies (now it will find /app/src)
RUN python -m pip install --no-cache-dir --upgrade pip \
&& python -m pip install --no-cache-dir -e .

# 3. Copy the remaining folders
COPY apps/api/static /app/static
COPY eval /app/eval
# 2. Explicitly install dependencies FIRST.
# This bypasses all pyproject.toml pathing issues.
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir \
"fastapi>=0.100.0" \
"uvicorn[standard]>=0.22.0" \
"pydantic>=2.0.0" \
"pydantic-settings>=2.0.0" \
"python-multipart>=0.0.6" \
"python-dateutil>=2.8.2" \
"thefuzz>=0.20.0" \
"python-Levenshtein>=0.23.0" \
"opik>=1.0.0" \
"openai>=1.0.0" \
"httpx>=0.24.1"

# 3. Copy your folders into a FLAT structure inside /app
# We take the content of apps/api/src and put it in /app/src
COPY apps/api/src ./src
COPY apps/api/static ./static
COPY eval ./eval

# 4. Set PYTHONPATH
# We tell Python that our code is in /app/src and our validators are in /app
ENV PYTHONPATH=/app:/app/src

EXPOSE 10000

# 5. Start the app using the flat path
CMD ["uvicorn", "planproof_api.main:app", "--host", "0.0.0.0", "--port", "10000"]