test / Dockerfile
karthikeya1212's picture
Update Dockerfile
5618b12 verified
# # Use official Python 3.11 slim image
# FROM python:3.11-slim
# # Set working directory
# WORKDIR /app
# # Install system dependencies
# RUN apt-get update && apt-get install -y --no-install-recommends \
# git \
# wget \
# curl \
# unzip \
# && rm -rf /var/lib/apt/lists/*
# # Copy project files
# COPY . .
# # Install Python dependencies
# RUN pip install --upgrade pip
# RUN pip install -r requirements.txt
# # Expose port
# EXPOSE 8000
# # Run FastAPI with uvicorn
# CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
# Use Python 3.11 slim
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
ffmpeg \
libgl1 \
libglib2.0-0 \
wget \
unzip \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy project files
COPY . .
# Expose API port for HF Spaces
EXPOSE 7860
# Start FastAPI with uvicorn
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]