# Use the official Python image
FROM python:3.12-alpine3.20

# Set the working directory
WORKDIR /app

# Copy and install dependencies
COPY requirements.txt .

RUN apk add --update --upgrade --no-cache postgresql-client && \
    apk add --update --upgrade --no-cache --virtual .tmp \
        build-base postgresql-dev

RUN pip install --no-cache-dir -r requirements.txt && apk del .tmp

# Copy the project files
COPY . .

# Expose Django's default port
EXPOSE 8000

# Run the Django development server
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]