email-classifier / api /Dockerfile
mrqadeer's picture
Initial project commit with code and figures
f6ea7de
Raw History Blame Contribute Delete
573 Bytes
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"]