Spaces:
Runtime error
Runtime error
File size: 715 Bytes
64252f7 34d0c34 b28b88d 34d0c34 b28b88d 34d0c34 b28b88d 34d0c34 b28b88d 34d0c34 b28b88d 2f7df58 7ca8651 | 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 | FROM python:3.12-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/home/user/app
# Create and set working directory
WORKDIR /home/user/app
# Install system dependencies
RUN apt-get update && apt-get install -y \
libpq-dev \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy all project files
COPY . .
# Collect static files, migrate, and start gunicorn
# Note: We bind to 0.0.0.0:7860 as required by Hugging Face
CMD python manage.py collectstatic --noinput && \
python manage.py migrate && \
gunicorn wsgi:application --bind 0.0.0.0:7860 |