File size: 1,302 Bytes
af0538f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f9ceb68
 
2adc8b6
af0538f
f9ceb68
a6ce46f
f9ceb68
a6ce46f
af0538f
f9ceb68
a6ce46f
8e4bb54
 
af0538f
a6ce46f
 
 
0973cbc
 
af0538f
f9ceb68
 
 
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
# Use an official Python runtime as a parent image
# Slim version is smaller but full version prevents some build issues with large ML libs
FROM python:3.10-slim

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

# Set work directory
WORKDIR /app

# Install system dependencies (needed for some python packages)
RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Install Python dependencies
# Install Python dependencies using uv for reproducible builds
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:/app/.venv/bin:${PATH}"

# Copy all metadata and manifests
COPY pyproject.toml uv.lock openenv.yaml README.md ./

# Copy the source code (required for uv project sync)
COPY backend/ /app/backend/
COPY server/ /app/server/
COPY frontend/ /app/frontend/
# Root-level entry points required by the OpenEnv grader
COPY inference.py /app/inference.py

# Sync dependencies (this now includes the project itself)
RUN uv sync --no-dev

# Expose the port (7860 is the official default for HuggingFace Spaces)
EXPOSE 7860

# Run the application via the uv-managed server script
# This ensures all compliance checks (uv.lock, [project.scripts]) are utilized
CMD ["uv", "run", "server"]