nn-garbage-project / Dockerfile
xuanzang's picture
Refactor Dockerfile and app.py for improved structure and readability; update requirements for compatibility with TensorFlow and OpenCV
748dbfa
raw
history blame contribute delete
471 Bytes
# Use Python 3.10 as the base image
FROM python:3.10-slim
# Set the working directory
WORKDIR /app
# Copy requirements and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the rest of the application code
COPY . .
# Make port 7860 available (required by Hugging Face Spaces)
EXPOSE 7860
# Start the FastAPI app with uvicorn on port 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]