{"id":16678507,"url":"https://github.com/felipenoris/math-server-docker","last_synced_at":"2025-09-21T12:15:23.730Z","repository":{"id":95279751,"uuid":"47785741","full_name":"felipenoris/math-server-docker","owner":"felipenoris","description":"The ideal multi-user Data Science server with Jupyterhub and RStudio, ready for Python, R and Julia languages.","archived":false,"fork":false,"pushed_at":"2019-12-15T15:41:36.000Z","size":408,"stargazers_count":74,"open_issues_count":3,"forks_count":18,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-13T13:29:30.057Z","etag":null,"topics":["data-science","docker","julia","julia-language","jupyter","jupyter-kernels","jupyterhub","jupyterlab","latex","python","rstudio-servers","shiny-server"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/felipenoris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-12-10T20:30:45.000Z","updated_at":"2024-09-10T01:32:23.000Z","dependencies_parsed_at":"2023-06-01T06:16:22.971Z","dependency_job_id":null,"html_url":"https://github.com/felipenoris/math-server-docker","commit_stats":null,"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipenoris%2Fmath-server-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipenoris%2Fmath-server-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipenoris%2Fmath-server-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipenoris%2Fmath-server-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felipenoris","download_url":"https://codeload.github.com/felipenoris/math-server-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221817533,"owners_count":16885555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-science","docker","julia","julia-language","jupyter","jupyter-kernels","jupyterhub","jupyterlab","latex","python","rstudio-servers","shiny-server"],"created_at":"2024-10-12T13:29:30.696Z","updated_at":"2025-09-21T12:15:18.671Z","avatar_url":"https://github.com/felipenoris.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# math-server-docker\n\n[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](LICENSE)\n\nDockerfile to build the ideal multi-user Data Science server with Jupyterhub and RStudio, ready for Python, R and Julia languages.\n\nIt's based on CentOS 7 image, which is a very stable Linux distribution, compatible with Red Hat (widely used in Corporations),\nbut often offers outdated packages. In order to provide up-to-date tools, this Dockerfile builds most tools from source.\n\n## List of tools\n\n* [Jupyterhub](https://github.com/jupyter/jupyterhub) and [Jupyterlab](https://github.com/jupyterlab/jupyterlab) with support for the following languages:\n\n\t* Python 2\n\n\t* Python 3\n\n\t* R\n\n\t* Bash\n\n* [RStudio Server](https://www.rstudio.com/)\n\n* [Shiny Server](https://www.rstudio.com/products/shiny/shiny-server2/)\n\nThere's also a number of utilities under the hood:\n\n* [Julia](https://julialang.org/)\n\n* [p7zip](http://p7zip.sourceforge.net)\n\n* [Java SDK](http://openjdk.java.net)\n\n* [Redis](https://redis.io)\n\n* [MongoDB](https://www.mongodb.com)\n\n* [git](https://git-scm.com)\n\n* [svn](https://subversion.apache.org)\n\n* [sqlite3](https://www.sqlite.org)\n\n* [pigz](https://zlib.net/pigz/)\n\n* [Node.js](https://nodejs.org)\n\n* [LaTeX](https://www.latex-project.org)\n\n* [HDF5](https://support.hdfgroup.org/HDF5/)\n\n* [uchardet](https://www.freedesktop.org/wiki/Software/uchardet/)\n\n## Usage\n\nTo build the image, run the following comand:\n\n```\n# docker build -t math-server .\n```\n\nBe patient. It may take up to 8 hours to complete.\n\nAfter the build is complete, you can start the server with:\n\n```\n# docker run -d -p 8787:8787 -p 8000:8000 --name ms1 math-server\n```\n\nWith a running container, you can go ahead and create users:\n\n```\n# docker exec ms1 useradd myuser\n\n# docker exec -it ms1 passwd myuser\n```\n\nThe default ports are:\n\n* `8787` for RStudio\n\n* `8000` for Jupyter\n\n## Requirements\n\n[Docker](https://www.docker.com/).\n\n## Application specific notes\n\nThe last command in the Dockerfile starts Jupyterhub and RStudio:\n\n```shell\nCMD /usr/lib/rstudio-server/bin/rserver \\\n\t\u0026\u0026 jupyterhub --no-ssl -f jupyterhub_config.py\n```\n\n### Jupyter\n\nData files are at `/usr/local/share/jupyter/hub`.\n\nBy default, Jupyter will be accessible on the following link: `http://localhost:8000`, and will create state files (`jupyterhub_cookie_secret`, `jupyterhub.sqlite`) on current directory, and use default configuration.\n\nYou can generate a sample configuration file with:\n\n```\n# jupyterhub --generate-config\n```\n\nTo start the server using a configuration file, use:\n\n```\n# jupyterhub -f jupyterhub_config.py\n```\n\nTo set IP and port, use:\n\n```\n# jupyterhub --ip=192.168.1.2 --port=443\n```\n\nYou may have to open port for external access:\n\n```\n# /sbin/iptables -I INPUT -p tcp -m tcp --dport 8000 -j ACCEPT\n# /sbin/service iptables save\n```\n\nFor `https` support, add the following lines to the config file:\n\n```python\nc.JupyterHub.port = 443\nc.JupyterHub.ssl_cert = '/root/.ssh/sample-cert.pem'\nc.JupyterHub.ssl_key = '/root/.ssh/sample-key.pem'\n```\n\n`443` is the default port for https. So the server will be accessible using https://localhost.\n\n`sample-cert.pem` is the signed certificate file, and `sample-key.pem` is the private ssl key.\n\nYou can generate self signed certificate file by running the code below, but be aware that your browser will not recognize the certificate as trusted.\n\n```\n# mkdir ~/.ssh\n# openssl req -x509 -newkey rsa:2048 -keyout ~/.ssh/sample-key.pem -out ~/.ssh/sample-cert.pem -days 9999 -nodes -subj \"/C=BR/ST=Rio de Janeiro/L=Rio de Janeiro/O=org/OU=unit/CN=website\"\n# chmod 400 sample*.pem\n```\n\nThis project provides a minimal `jupyter_config.py` configuration file that sets\na few important environment variables that should be passed to child spawned processes, namely: `'PATH', 'LD_LIBRARY_PATH', 'JAVA_HOME', 'CPATH', 'CMAKE_ROOT', 'http_proxy', 'https_proxy'`.\n\n### Jupyterlab\n\nJupyterlab is the default user interface. This behavior is set by the following line in the provided jupyterhub_config.py file:\n\n```\nc.Spawner.default_url = '/lab'\n```\n\nTo revert to old Jupyter user interface, you can either access manually the `/tree` url (as in `http://localhost:8000/user/username/tree`)\nor edit `jupyterhub_config.py` deleting the `c.Spawner.default_url` line.\n\nSee [Jupyterlab documentation](http://jupyterlab.readthedocs.io/en/latest/user/jupyterhub.html) for more information.\n\n### RStudio\n\nConfiguration files are at `/etc/rstudio`. There's also the Server Options file at `/usr/lib/rstudio-server/R/ServerOptions.R`.\n\nDefault port is 8787.\n\nChange the default port by editing `rserver.conf`. The following will change to port 80:\n\n```\n# echo -e \"www-port=80\" | tee /etc/rstudio/rserver.conf\n# rstudio-server restart\n# rstudio-server verify-installation\n```\n\n`auth-pam-sessions-profile` directive on /etc/rstudio.rserver.conf may not work. If that happens, RStudio will look at `/etc/pam.d/rstudio`.\n\nProxy settings are not configured in RStudio by default. If you're running behind proxy, you should update `ServerOptions.R` file.\n\n```\nRUN echo \"options(download.file.method = 'wget')\" \u003e\u003e /usr/lib/rstudio-server/R/ServerOptions.R\nRUN echo \"Sys.setenv(http_proxy = 'my-proxy-url')\" \u003e\u003e /usr/lib/rstudio-server/R/ServerOptions.R\nRUN echo \"Sys.setenv(https_proxy = 'my-proxy-url')\" \u003e\u003e /usr/lib/rstudio-server/R/ServerOptions.R\n```\n\n## Packages\n\n**Python**\n\nUsers can packages with `conda` or `pip` command line.\n\nWith pip, users can install local packages for Python2 using:\n\n```\n$ source activate py2\n\n$ pip install --user pkgname\n```\n\nAnd also for Python3 using:\n\n```\n$ source activate py3\n\n$ pip install --user pkgname\n```\n\nRefer to `conda` documentation to install packages using `conda` utility.\n\n**R**\n\nCheck package locations with `$ R -e '.libPaths()'`.\n\nSystem packages will be installed at `/usr/lib64/R/library`.\n\nEach user can have a local package dir, automatically created under `~/R`.\n\n*root user* will add packages with `R -e 'install.packages(\"pkg-name\")'` command.\n\n**Julia**\n\nSince Julia v1.0, system packages are disabled. Only user-level packages are supported.\n\nTo install IJulia kernel, open a terminal and use the following commands:\n\n```shell\njulia\u003e using Pkg\n\njulia\u003e pkg\"add IJulia\"\n```\n\nRestart your Jupyter session. After that, a Julia notebook option should show up.\n\n**LaTeX**\n\nThe Docker image comes with a LaTeX distribution that is installed using [texlive](http://www.tug.org/texlive/) tool.\nTeX packages can me managed using `tlmgr`.\n\nSystem-wide packages can be installed using:\n\n```\n# tlmgr install [pkgname]\n```\n\nUsers can also install local packages. To do that, a user must initialize a `~/texmf` tree:\n\n```\n$ tlmgr init-usertree\n```\n\nAfter that, the user can install local packages using:\n\n```\n$ tlmgr --usermode install [pkgname]\n```\n\n## References\n\n* [Jupyterhub Docs](https://jupyterhub.readthedocs.org/en/latest/index.html)\n\n* [Jupyterlab Docs](http://jupyterlab.readthedocs.io)\n\n* [Full list of supported kernels for Jupyter](https://github.com/ipython/ipython/wiki/IPython-kernels-for-other-languages)\n\n* [RStudio Server Admin Guide](https://s3.amazonaws.com/rstudio-server/rstudio-server-pro-0.99.879-admin-guide.pdf)\n\n* [Shiny Server Admin Guide](http://rstudio.github.io/shiny-server/latest/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipenoris%2Fmath-server-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelipenoris%2Fmath-server-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipenoris%2Fmath-server-docker/lists"}