# Use an official Python runtime as a parent image FROM python:3.13-slim-trixie # Set environment variables ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # Set working directory WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ libpq-dev \ default-libmysqlclient-dev \ pkg-config \ && rm -rf /var/lib/apt/lists/* # Install Python dependencies COPY requirements.txt /app/ RUN pip install --no-cache-dir -r requirements.txt RUN pip install gunicorn # Copy project files COPY . /app/ # Expose the port on which the application will run EXPOSE 3030 # Define environment variable for Gunicorn ENV GUNICORN_CMD_ARGS="--bind 0.0.0.0:3030" # Collect static files and run Gunicorn CMD ["sh", "-c", "python manage.py collectstatic --noinput && gunicorn BH.wsgi:application"]