
# FROM python:3.13.7-alpine3.19
# FROM python:3.13.7-bookworm
# FROM ubuntu:jammy-20240227
# FROM python:3.13.9-slim
FROM debian:bookworm-slim


# Set bash as default shell
SHELL ["/bin/bash", "-lc"]
# ENV SHELL=/bin/bash
RUN apt-get update && apt-get install -y bash sudo xz-utils unzip curl git
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
WORKDIR /app
COPY . /app
RUN /root/.local/bin/uv tool install --python 3.14 --editable .
# RUN /root/.local/bin/uv tool install --python 3.14 stackops>=26.11.2

RUN /root/.local/bin/devops software install --group sysabc
RUN /root/.local/bin/devops software install --group termabc

RUN /root/.local/bin/devops config copy-assets all
RUN /root/.local/bin/devops config dotfiles sync down --sensitivity public --method symlink --which all --on-conflict overwrite-default-path
RUN /root/.local/bin/devops config terminal config-shell --which default

RUN touch /root/.bash_history
# McFly complains about missing history file
RUN rm -rfd /root/tmp_results
# This directory is full of tmp installers files. (200MB)
# RUN apt-get clean && \
#     rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/cache/apt/archives/* /var/log/* /usr/share/doc /usr/share/man /usr/share/info /usr/share/locale

RUN /root/.local/bin/uv cache clean --force && \
    rm -rfd /root/.cache/pip

WORKDIR /root
CMD ["/usr/bin/bash"]
# python image defaults to python as the command
