# Use an official Python runtime as a parent image FROM python:3.12-slim # Set environment variables ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 ENV PORT 7860 # Set work directory WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ libgl1 \ libglib2.0-0 \ git \ && rm -rf /var/lib/apt/lists/* # Install dependencies COPY requirements.txt /app/ RUN pip install --no-cache-dir -r requirements.txt # Copy project COPY . /app/ # Create media and static directories RUN mkdir -p /app/media /app/static # Run migrations, create superuser and collectstatic RUN python manage.py migrate RUN python create_superuser.py RUN python manage.py collectstatic --noinput # Expose the port Gradio/Hugging Face expects EXPOSE 7860 # Start the application using Gunicorn CMD ["gunicorn", "--bind", "0.0.0.0:7860", "satcap_project.wsgi:application"]