FROM ubuntu:24.04

RUN apt update  && \
	apt install -y ca-certificates curl ffmpeg keychain python3 software-properties-common && \
	add-apt-repository ppa:m-grant-prg/utils && \
	apt update && apt install -y get-iplayer && \
	rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*

ADD https://astral.sh/uv/install.sh /uv-installer.sh
RUN sh /uv-installer.sh && mv /root/.local/bin/uv /usr/local/bin/uv && rm /uv-installer.sh

RUN userdel ubuntu && groupadd -r florian -g 1000 && \
	useradd -u 1000 -r -g florian -m -d /home/florian -s /bin/bash florian && \
	mkdir /app && chown -R florian:florian /app

USER florian
WORKDIR /home/florian
COPY requirements.txt ./
RUN uv venv && uv pip install -r requirements.txt

WORKDIR /app