What I’m trying to do:
I am hosting my app on Digital Ocean. I set up everything (note for other people trying this in the near future, downgrade Python to version 3.11 before trying to install the app server) and the app seems to work fine. Now I am wondering what the normal workflow for this kind of solution is.
Am I correct in assuming that maintenance / development is done using the anvil website and each time I have a change in the code I need to git pull the changes and restart the server? Or is there a way to develop on the hosting machine with the use of the anvil tools (like the database viewer, form creator etc)?
Thanks in advance!
Rob
Yes, if you’re using the hosted visual editor, a typical workflow is to use the IDE at anvil.works to update your application, then restart the application on your production server after using Git to fetch and merge changes. I’ll typically automate with an ./update.sh script in the folder where anvil-app-server runs, something like:
cd APP_NAME
git fetch origin
git merge origin/master
cd ..
anvil-app-server --app APP_NAME --origin https://yourdomain.com:1234 --dep-id C6ZZPAPN4YYF5NVJ=anvil_extras_main --auto-migrate --port 4043 --disable-tls
I typically run each app in its own tmux session, so that stopping and restarting is easy. I also use Caddy whenever I need to run more than one instance of anvil-app-server over HTTPS (Anvil’s embedded Traefik binary only runs on port 443)
If you’re building your UIs and all configuration files entire with code (i.e., not using the hosted visual editor), then you can simply edit all your files directly on the server.
I posted a cheatsheet and some videos about how to do it all: Anvil-app-server cheatsheet
4 Likes