# ./backend/Dockerfile # Use an official Python runtime as a parent image FROM python:3.12-slim # Set environment variables ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 # Set work directory WORKDIR /app # Install Python dependencies # Copy only requirements first to leverage Docker cache COPY requirements.txt ./ RUN pip install --no-cache-dir -r requirements.txt # Copy the entrypoint script first COPY ./entrypoint.sh /app/entrypoint.sh # Ensure it's executable inside the container too RUN chmod +x /app/entrypoint.sh # Copy the rest of the backend source code COPY . . # Set the entrypoint script ENTRYPOINT ["/app/entrypoint.sh"] # Set the default command that the entrypoint will execute if none is provided by compose # This is useful if you run the image directly without compose sometimes CMD ["python", "manage.py", "runserver", "0.0.0.0:8080"]