Spaces:
Sleeping
Sleeping
File size: 824 Bytes
8e86045 a36bf81 903c049 8e86045 dd6cfec 8e86045 a36bf81 dd6cfec | 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 | # Use the official Python image
FROM python:3.13-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set work directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# Copy project
COPY . .
# RUN chown www-data: /app/db.sqlite3
RUN chmod -R 777 /app
# Collect static files (optional if you want to serve static files from the app itself)
# RUN python manage.py collectstatic --noinput
# Expose port 8000
EXPOSE 7860
# Run the Django app
CMD ["bash", "-c", "python manage.py migrate && python create_superuser.py && python manage.py runserver 0.0.0.0:7860"]
|