# Using the Python 3 slim base
FROM python:3.11-slim

# Setup the working directory
WORKDIR /app

RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*

# Clone Redfish Event Listener
RUN git clone https://github.com/DMTF/Redfish-Event-Listener.git src

RUN pip install --no-cache-dir -r /app/src/requirements.txt

# prepare runtime directory
RUN mkdir -p /app/data

COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh

ENV REL_HTTPS_PORT=443
ENV REL_CERT_FILE=cert.pem
ENV REL_KEY_FILE=key.pem

ENTRYPOINT ["/app/entrypoint.sh"]
