FROM debian:bookworm

ENV DEBIAN_FRONTEND=noninteractive \
    PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    CODEX_HOME=/home/codex

RUN apt-get update \
    && apt-get install --yes --no-install-recommends \
        ca-certificates \
        curl \
        nodejs \
        npm \
        python3 \
        python3-venv \
        tzdata \
    && npm install --location=global @openai/codex \
    && groupadd --gid 1000 codex \
    && useradd --uid 1000 --gid 1000 --create-home --shell /bin/bash codex \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY watch_and_customize.py entrypoint.sh JobDescriptionNormalizerPrompt.md ./

RUN chmod +x /app/watch_and_customize.py /app/entrypoint.sh

USER codex

ENTRYPOINT ["/app/entrypoint.sh"]
