Hedgehog-Computing / hedgehog-lab

Run, compile and execute JavaScript for Scientific Computing and Data Visualization TOTALLY TOTALLY TOTALLY in your BROWSER! An open source scientific computing environment for JavaScript TOTALLY in your browser, matrix operations with GPU acceleration, TeX support, data visualization and symbolic computation.
https://hlab.app
Apache License 2.0
2.37k stars 142 forks source link

add docker file #186

Closed t-lou closed 2 years ago

t-lou commented 2 years ago

Docker file based on debian for easier deployment

preferred entry: docker run -p 3000:3000 hedgehog-lab sh /opt/run.sh

p3nj commented 2 years ago

According to Offical Node Image from Docker Hub, maybe this will be more efficient if use 18-bullseye and start from there? Probably should seperate all commands to multiple RUN as well.

t-lou commented 2 years ago

According to Offical Node Image from Docker Hub, maybe this will be more efficient if use 18-bullseye and start from there? Probably should seperate all commands to multiple RUN as well.

I tried both node:18-bullseye and node:18-bullseye-slim, besides the need-to-be-overridden entry point, many other packages need to be installed, including xorg. I think in this case, using debian and node bases have little difference. How do you think?

Refactored the dockerfile to be more structured. Still prefer to have fewer layers.

AGDholo commented 2 years ago

Hi @t-lou, Thanks for your PR xorg is necessary? We are just a static react site project, why should we need it?

t-lou commented 2 years ago

I neither, during the command "yarn install" in phase 4 it asked for x11, xi or {another lib, which I forget}. X11 is basically xorg. When I tried to install libxi-dev, it asked for <GL/glx.h>.

Thus I assume node docker would not be a better solution.

AGDholo commented 2 years ago

Okay, it might be because of the 'ml-x' package in hlab-core. Thanks your PR, we will merge.

t-lou commented 2 years ago

I remember seeing a question from email notification. So we need the port to connect the browser in host system and the program in docker container.