FROM continuumio/miniconda3

# Install dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    btop \
    cmake \
    gdb \
    gh \
    git \
    zsh \
    sudo \
    wget \
    libeigen3-dev \  
    libboost-all-dev \  
    binutils \  
    && rm -rf /var/lib/apt/lists/*

# Set up a non-root user with sudo
RUN useradd -ms /bin/zsh user && echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/user

USER user
WORKDIR /home/user/repos

# Install Oh My Zsh
RUN sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)" "" --unattended

# Install zsh autosuggestions
RUN git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

# Install zsh syntax highlighting
RUN git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

# Configure zsh
RUN sed -i 's/plugins=(git)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting)/' ~/.zshrc

# Create a new conda environment with Python 3.14 and fix the bug with VS-code terminal showing 2 conda env prompts 
RUN . /opt/conda/etc/profile.d/conda.sh && \
    conda config --set auto_activate_base False && \
    /opt/conda/bin/conda create -n piq-dev python=3.14 -y && \
    conda activate piq-dev

# Initialize conda for zsh shell
RUN echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.zshrc

# Install pybind11 in the conda environment
RUN . /opt/conda/etc/profile.d/conda.sh && \
    conda activate piq-dev && \
    pip install pybind11

# Set up zsh as the default shell
SHELL ["/bin/zsh", "-c"]

# Set zsh as the default shell for the container
CMD [ "zsh" ]