FROM python:3.11-slim

# Set timezone and install required libs for plotting
ENV TZ=America/Denver
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    tzdata \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Ensure unbuffered python logs native to Cloud Logging
ENV PYTHONUNBUFFERED=1

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

# Expose Cloud Run default port
EXPOSE 8080

RUN chmod +x entrypoint.sh

# Engage Unified Engine
CMD ["./entrypoint.sh"]
