# Get the base Python image
FROM python:latest

# Install system dependencies
RUN apt-get update && apt-get install -y virtualenv gfortran libgtk-3-dev nano

# Add a non-privileged user
RUN useradd -ms /bin/bash -d /opt/msspec msspec

# Set the working directory in the container
USER msspec
RUN mkdir -p /opt/msspec/code
WORKDIR /opt/msspec/code

# Fetch the code
RUN git clone https://git.ipr.univ-rennes1.fr/epsi/msspec_python3.git .
#COPY --chown=msspec:msspec . .

# Install msspec
ENV PATH=/opt/msspec/.local/bin:$PATH
RUN make install VERBOSE=1

# Run the msspec frontend command on startup
ENTRYPOINT ["msspec"]
