Dockerfile 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. FROM jupyter/minimal-notebook:latest
  2. # Install fmipy
  3. RUN /opt/conda/bin/conda install -c conda-forge fmpy -y --quiet
  4. # Install simpy
  5. RUN /opt/conda/bin/conda install sympy
  6. # Install scipy
  7. RUN /opt/conda/bin/conda install scipy
  8. USER root
  9. # Install Julia 0.6
  10. RUN mkdir /opt/julia && \
  11. cd /opt/julia && \
  12. wget --quiet https://julialang-s3.julialang.org/bin/linux/x64/0.6/julia-0.6.4-linux-x86_64.tar.gz && \
  13. tar -xzf julia-0.6.4-linux-x86_64.tar.gz --directory . --strip-components=1 && \
  14. ln -s /opt/julia/bin/julia /usr/bin/julia && \
  15. julia --version
  16. RUN mkdir /opt/bondgraphs
  17. COPY test_bondgraphs.py /opt/bondgraphs/
  18. # Install BondGraphTools and run test file (forces installation of dependencies)
  19. RUN apt-get update -y && \
  20. apt-get install -y dvipng && \
  21. pip install BondGraphTools && \
  22. python3 /opt/bondgraphs/test_bondgraphs.py
  23. # Copy local files to the remote notebooks
  24. RUN mkdir /opt/notebooks
  25. COPY 1-NewtonsLaws /opt/notebooks/1-NewtonsLaws
  26. COPY 2-StationaryAction /opt/notebooks/2-StationaryAction
  27. COPY 3-BondGraphs /opt/notebooks/3-BondGraphs
  28. WORKDIR /opt/notebooks/
  29. # Port
  30. EXPOSE 8888
  31. # Run Jupyter Notebook
  32. CMD ["/opt/conda/bin/jupyter", "notebook", "--notebook-dir=/opt/notebooks", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"]
  33. # Uncomment to access command line on the docker container
  34. # CMD ["bash"]
  35. # to start jupyter run: /opt/conda/bin/jupyter notebook --notebook-dir=/opt/notebooks --ip=0.0.0.0 --port=8888 --no-browser --allow-root