# syntax=docker/dockerfile:1
FROM python:3.12-slim
ENV PYTHONUNBUFFERED=1
WORKDIR /app

# Install the package and its runtime deps from source
COPY pyproject.toml README.md LICENSE ./
COPY tgoti ./tgoti
RUN pip install --no-cache-dir .

# Run as a non-root user; the SQLite save DB lives under its home data dir
RUN useradd --create-home tgoti
USER tgoti

# tgoti is a TUI — run it interactively:
#   docker run -it --rm tgoti
# Headless read-only commands work too, e.g.:
#   docker run --rm tgoti --list-saves
ENTRYPOINT ["tgoti"]
