ohamlab-ai-toolkit / Dockerfile
rahul7star's picture
dock
2bf6a09 verified
raw
history blame contribute delete
784 Bytes
FROM python:3.10-slim
# Install required system packages
RUN apt update && apt install -y \
git \
libgl1 \
libglib2.0-0 \
&& apt clean
# Set working directory
WORKDIR /app
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the entire project directory
COPY . .
# Create tmp and output directories with full permissions
RUN mkdir -p /app/tmp /app/output && \
chmod 777 /app/tmp /app/output
# Create a non-root user and set ownership
RUN useradd -m -u 1000 appuser && \
chown -R appuser:appuser /app
# Switch to non-root user
USER appuser
# Expose the port for FastAPI (Hugging Face Spaces)
EXPOSE 7860
# Start the FastAPI app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]