api / Dockerfile
gary-boon
Deploy Visualisable.ai backend with API protection
c6c8587
raw
history blame
709 Bytes
# Backend-only Dockerfile for Hugging Face Spaces
FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy and install Python requirements
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy backend code
COPY backend/ ./backend/
COPY app.py .
# Create a simple health check endpoint
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:7860/health || exit 1
# Expose the Hugging Face Spaces default port
EXPOSE 7860
# Run the FastAPI app with Uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]