rare-skin-backend / Dockerfile
swanthalok-stack's picture
Upload Dockerfile with huggingface_hub
3f8befc verified
Raw
History Blame
702 Bytes
FROM python:3.10-slim
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /code
# Copy requirements and install them securely
COPY ./backend/requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Copy the rest of your backend folder into the container
COPY . /code/
# Set up paths so the app knows where to look
ENV PYTHONPATH=/code/backend:/code/backend/app:$PYTHONPATH
# Fire up the FastAPI server on Hugging Face's required port
CMD ["uvicorn", "backend.ml_service:app", "--host", "0.0.0.0", "--port", "7860"]