OK - I am sorry if this is obvious to others…
But, if so, should be easy and quick to provide an answer
My setup of Sanic is on debian server. Currently serving “hello world”. My plan is (while learning sanic) to move 3 or 4 old websites (been inactive for some time) across from Flask and modernise them a little, while re-hosting them and reactivating them.
These websites are completely unrelated to each other.
I have sanic running - and is setup to restart each reboot - just by setting in crontab. like this:
@reboot screen -S sanic_server1 -dm bash -c 'source /root/start_sanic'
And the sh is:
#!/bin/bash
cd /root/sanic
source /root/sanic/env/bin/activate
sanic first.app --dev
So the sanic console is running in a disconnect Screen session.
I was imagining that I would do it like this: for the second (and third, 4th, etc) website(s). I will just add another crontab entry , another server instance in its own Screen session, all from the same virtualenv… Like this :
#!/bin/bash
cd /root/sanic
source /root/sanic/env/bin/activate
sanic second.app --dev
And so on for the third and 4th … etc. Is that how it is usually done ? or usually do most people run Sanic once only, and have really big server.py
that includes functionality for each one of these website-backends, all in the same python file ?
I am not trying to go “non-standard”. Just am unaware what is the usual way people do it.
All constructive comments welcome