Spaces:
Sleeping
Sleeping
File size: 658 Bytes
09ff205 | 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 | # Use python 3.9 or 3.10
FROM python:3.12
# Set the working directory
WORKDIR /code
# Copy the requirements file
COPY ./requirements.txt /code/requirements.txt
# Install dependencies (No cache to save space, though HF has 16GB)
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Copy the rest of your code
COPY . /code
# Create a non-root user (Hugging Face Security Requirement)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Expose port 7860 (Hugging Face specific port)
EXPOSE 7860
# Start the app on port 7860
CMD ["uvicorn", "tp_final:app", "--host", "0.0.0.0", "--port", "7860"] |