DockerfileTutorials123 1.4 KB

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