Spaces:
Runtime error
Runtime error
# Use Python 3.10 as base image | |
FROM python:3.10-slim | |
# Set working directory | |
WORKDIR /app | |
# Install system dependencies | |
RUN apt-get update && apt-get install -y \ | |
build-essential \ | |
git \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Create a non-root user and set up directories | |
RUN useradd -m -u 1000 user \ | |
&& mkdir -p /app/.cache \ | |
&& chown -R user:user /app | |
# Switch to non-root user | |
USER user | |
# Copy requirements first to leverage Docker cache | |
COPY --chown=user:user requirements.txt . | |
COPY --chown=user:user bitsandbytes-0.44.1.dev0-py3-none-manylinux_2_24_x86_64.whl . | |
# Install Python dependencies | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy the rest of the application | |
COPY --chown=user:user . . | |
# Expose the port Gradio will run on | |
EXPOSE 7860 | |
# Set environment variables | |
ENV PYTHONUNBUFFERED=1 | |
ENV GRADIO_SERVER_NAME=0.0.0.0 | |
ENV GRADIO_SERVER_PORT=7860 | |
# Run ls and pwd | |
RUN ls -la | |
RUN ls -la /app | |
RUN pwd | |
# Run the application | |
CMD ["python", "app.py"] |