-
Notifications
You must be signed in to change notification settings - Fork 174
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (23 loc) · 874 Bytes
/
Dockerfile
File metadata and controls
32 lines (23 loc) · 874 Bytes
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
FROM python:3.10-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc build-essential curl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="$PATH:/root/.local/bin"
# Copy dependency files and README (needed for package build)
COPY pyproject.toml uv.lock README.md ./
# Install dependencies and create virtual environment
RUN uv sync --frozen
# Copy application code
COPY . .
# Set Python to run in unbuffered mode (recommended for Docker)
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/app
# Expose the port the app will run on
EXPOSE 8000
# Default to running only the API server; worker and train-api are separate Compose services
CMD ["uv", "run", "uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]