mljar / mercury

Convert Jupyter Notebooks to Web Apps

Home Page:https://RunMercury.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can we change or set up the setting for REACT_APP_SERVER_WS

linhjindo opened this issue · comments

Hi,

I am not good at the React setting.

I had a problem when I deployed Mercury via docker swarm from a manager machine A to a worker machine B (A and B connected only by internal IPs)
The problem is that I access Mercury with A's public IP/domain, and Mercury opens WS to A's public IP/domain, which does not work as it cannot reach the WS server running on machine B.

Is there any way to make Mercury send the WS connection using the A's internal IP instead?

Thank you so much,

Hi @linhjindo,

You should be able to setup the two machines. Please set REACT_APP_SERVER_WS environment variable before building frontend. Here you have Docker that is used to create frontend https://github.com/mljar/mercury/blob/main/docker/nginx/Dockerfile - it is created in line 11.

If you will need more help, please let me know.

Hi @pplonski

Thanks for your quick reply.

How can I set REACT_APP_SERVER_WS if I run Mercury from the package installed by pip install.

It is not possible. You need to build frontend by yourself with env variable set before running yarn build.