Spaces:
Sleeping
Sleeping
# Use a Python base image | |
FROM python:3.9-slim-buster | |
# Set working directory | |
WORKDIR /app | |
# Install dependencies | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy your application code | |
COPY app.py . | |
# Expose the port your API will run on (Hugging Face Spaces uses 7860 by default for Gradio/Streamlit, | |
# but for custom Docker, you can choose, e.g., 8000 for FastAPI or 5000 for Flask). | |
EXPOSE 8000 | |
# Command to run your FastAPI/Flask app | |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"] # For FastAPI | |
# CMD ["python", "app.py"] # For a simple Flask app |