stpete2's picture
Create app.py
e912f66 verified
raw
history blame
605 Bytes
FROM nvidia/cuda:11.6.2-base-ubuntu20.04
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /code
# Install Python and dependencies
RUN apt-get update && \
apt-get install -y python3 python3-pip git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Copy requirements and install
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt
# Copy app files
COPY app.py .
# Set environment variables for HF
ENV HF_HOME=/code
# Expose port
EXPOSE 7860
# Run the application with proper host to expose externally
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]