-3

I am new to dash app development and created a app which is running in the linux server. It is available to all users in our intranet only when I trigger and online. Once I logoff it is not accessible. How to schedule the app to run continuously even when I am offline. Any responses would be appreciated.

currently it is serving with below command

python app.py

I cant deploy in Heroku due to security restrictions. Docker also unavailable. Any other option would be appreciated.

Regards, Sudheer

  • How did you launch the app on the server? Do you SSH to the server and run it like `python app.py`? – Kota Mori Oct 31 '21 at 10:02
  • Yes currently i am running as python app.py – Sudheer Anumala Oct 31 '21 at 10:06
  • Please add more details on how you are serving (running) the app and so one. Also try and search for tutorials on how to serve python applications, there are many out there. – Aless55 Oct 31 '21 at 10:37
  • I cant deploy in Heroku due to security restrictions. Docker also unavailable. Any other option would be appreciated. – Sudheer Anumala Oct 31 '21 at 10:43
  • servers which can run flask code should have special methods to start it. Some of them may use `Gunicorn` to run it. They can also use [supervisord](http://supervisord.org/) to start application and control if it is still running and restart it if it is crush. Method `python app.py` is only to test code on local server. – furas Oct 31 '21 at 15:33

1 Answers1

1

From this description, I guess that you

  1. SSH into the server
  2. Run python app.py
  3. At this point, the app is available
  4. Log off from the SSH connection (e.g. exit command)
  5. At this point, the app is not available any more

If so, this is because the command you run during the SSH session will be terminated when you log off from the session. There are several ways to keep your app running after you log off. For example,

  • Run nohup python app.py &.
  • Run tmux and run python app.py in the tmux window. Then Ctrl+b+d to close the tmux window.

In either way, the app will keep running after you log off from the SSH connection. If my guess about your situation is wrong, please elaborate on your situation more in detail. For example, tell us the series of command you run and what happens with them.

In particular, the term "offline" is not clear in this context. If you are completely offline and not connected even to the intranet, then there is no chance that you can use the app running on the server.

Kota Mori
  • 6,510
  • 1
  • 21
  • 25