AC02-ML / Dockerfile
deropxyz's picture
Fix Dockerfile: Remove non-existent models folder copy and fix health endpoint
60e8834
raw
history blame contribute delete
607 Bytes
FROM python:3.11-slim
# Optional system packages for faster numpy/pandas builds
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install Python dependencies first to leverage Docker layer caching
COPY api/requirements.txt ./requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY api ./api
# Spaces injects the listening port through the PORT env var
ENV PORT=7860
# Expose FastAPI via uvicorn
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "7860"]