# Use an official Python runtime as a parent image
FROM python:3.9-slim

# Set the working directory (matches volume mount point in docker-compose if used, but crucial for CMD)
WORKDIR /app

# Install system dependencies for psycopg2 (if using regular psycopg2, but binary usually ok on slim)
# Just in case, install libpq-dev for psycopg2 compilation if needed, but psycopg2-binary should be fine.
# If binary fails, we might need build-essential libpq-dev.
# For now, stick to slim + binary.

# Copy requirements file
COPY requirements.txt ./

# Install python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application code
COPY scripts/ ./scripts/

# Run the scheduler script
CMD ["python", "scripts/check_pending_publications.py"]
