Hi,
I have a Python script that I want to deploy as an app on DigitalOcean. My main concern is whether the App Platform will ensure the app is constantly running because I’m using the script as a WebSocket server. The script needs to always be running on the server.
I’m deploying it using the following command:
uvicorn main:app --host 0.0.0.0 --port 10000
Can anyone explain how I can achieve this?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Heya, @amiladeshan
I believe a similar question was asked in the community which you can check here:
https://www.digitalocean.com/community/questions/how-do-i-run-a-web-service-with-websockets-on-app-platform
Services that you run on the App Platform are exposed via app domains on port 443/HTTPS. So you should also use the
wss://
scheme when connecting. This is not necessarily the same port as you would specify that your service is listening on internally.Hope that this helps!
Heya,
The short answer is yes, it will do it for you. The a bit longer answer you can check in the mentioned discussion.