FROM 086679231553.dkr.ecr.us-east-1.amazonaws.com/docker-parent-images:debian13

USER root
WORKDIR     /var/app
COPY        --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
COPY        --from=peakcom/s5cmd:latest /s5cmd /bin/

RUN apt update -y && apt-get install -y gnupg curl
RUN curl -fsSL https://debian.neo4j.com/neotechnology.gpg.key | gpg --dearmor -o /usr/share/keyrings/neo4j.gpg
RUN echo "deb [signed-by=/usr/share/keyrings/neo4j.gpg] https://debian.neo4j.com stable 5" | tee /etc/apt/sources.list.d/neo4j.list

RUN echo "neo4j-enterprise neo4j/accept-license select Accept commercial license" | debconf-set-selections

RUN apt update -y && apt-get install -y neo4j-enterprise=1:5.26.18
RUN apt upgrade -y

ADD --chown=worker:worker config.py index.py pyproject.toml uv.lock additional.conf refresh_neo4j.py /app/

WORKDIR /app
RUN uv sync --locked

CMD ["uv", "run", "/app/index.py"]
