File size: 898 Bytes
1624b73
fa37a6b
1624b73
 
 
 
 
 
 
 
 
 
 
a08738a
1624b73
 
 
 
 
 
 
 
 
 
 
 
 
 
752f799
1624b73
752f799
6241edf
1624b73
 
 
 
6241edf
 
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
35
36
37
38
39
# 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"]