Spaces:
Sleeping
Sleeping
File size: 728 Bytes
c8f627b 68686af |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Install system dependencies (gcc for some python packages)
RUN apt-get update && apt-get install -y \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first to leverage cache
COPY requirements.txt .
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application
COPY . .
# Create a directory for the database in a writable location if needed,
# or ensure the current directory is writable.
# HF Spaces usually run as user 1000.
RUN chmod -R 777 /app
# Environment variables
ENV PORT=7860
# Expose the port (optional metadata)
EXPOSE 7860
# Run the application
CMD ["python", "run.py"]
|