2021-01-22 17:32:12 +01:00
|
|
|
# Get the base Python image
|
2021-06-27 21:42:22 +02:00
|
|
|
FROM python:latest
|
2021-01-22 17:32:12 +01:00
|
|
|
|
|
|
|
# Set the working directory in the container
|
|
|
|
WORKDIR /code
|
|
|
|
|
|
|
|
# Fetch the code
|
2021-06-27 21:42:22 +02:00
|
|
|
RUN git clone --branch devel https://git.ipr.univ-rennes1.fr/epsi/msspec_python3.git .
|
2021-01-22 17:32:12 +01:00
|
|
|
|
|
|
|
# Install system dependencies
|
2021-06-27 21:42:22 +02:00
|
|
|
RUN apt-get update && apt-get install -y virtualenv gfortran libgtk-3-dev
|
2021-01-22 17:32:12 +01:00
|
|
|
|
|
|
|
# Install msspec
|
2021-06-27 21:42:22 +02:00
|
|
|
ENV PATH=/opt/bin:$PATH
|
2021-01-22 17:32:12 +01:00
|
|
|
RUN make install VERBOSE=1 INSTALL_PREFIX=/opt
|
|
|
|
|
2021-06-27 21:42:22 +02:00
|
|
|
# Add a non-privileged user
|
|
|
|
RUN useradd -ms /bin/bash msspec
|
2021-01-22 17:32:12 +01:00
|
|
|
USER msspec
|
2021-06-30 12:44:06 +02:00
|
|
|
WORKDIR /home/msspec
|
2021-07-02 18:21:10 +02:00
|
|
|
|
|
|
|
# Customize a bit the prompt and load the msspec virtualenv
|
|
|
|
RUN echo "alias idle=\"python -m idlelib.idle 2>/dev/null\"" >> .bashrc && \
|
|
|
|
echo "export PS1=\"\w\$ \"" >> .bashrc && \
|
|
|
|
echo "$(msspec -e)" >> .bashrc && \
|
|
|
|
mkdir data && \
|
|
|
|
cp /code/doc/source/tutorials/copper/Cu_simple.py data/example.py
|
2021-01-22 17:32:12 +01:00
|
|
|
|
2021-06-27 21:42:22 +02:00
|
|
|
# Run the msspec frontend command on startup
|
2021-06-30 12:44:06 +02:00
|
|
|
ENTRYPOINT ["/bin/bash"]
|