Spaces:
Paused
Paused
File size: 573 Bytes
f6ea7de | 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 | FROM python:3.12-slim
WORKDIR /app
# Install uv globally
RUN pip install --no-cache-dir uv
# Copy the entire project directory
# .dockerignore should exclude .venv and other unnecessary files
COPY . .
# Create venv with uv and install dependencies
RUN uv venv /app/.venv && \
. /app/.venv/bin/activate && \
uv pip install . && \
uv sync
# Set environment variable to use the venv
ENV PATH="/app/.venv/bin:$PATH"
# Expose the port the API runs on
EXPOSE 8000
# Command to run the API
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]
|