←back to thread

DigitalOcean App Platform

(pages.news.digitalocean.com)
646 points digianarchist | 1 comments | | HN request time: 0.209s | source
Show context
simonw ◴[] No.24705120[source]
I tried this out today and figured out how to run a custom Python application there. You only need two files in a GitHub repo for that: a requirements.txt listing your dependencies and a Procfile that starts a process listening on port $PORT and IP 0.0.0.0.

My Procfile looks like this:

    web: datasette . -h 0.0.0.0 -p $PORT
Full notes here: https://til.simonwillison.net/til/til/digitalocean_datasette...
replies(1): >>24706912 #
vdfs ◴[] No.24706912[source]
This is built on top of Heroku runtime, more info on Procfile here: https://devcenter.heroku.com/articles/procfile

Also, note that you shouldn't use SQLite, at least with heroku, because apps should be stateless https://12factor.net/processes

replies(2): >>24708312 #>>24708670 #
1. simonw ◴[] No.24708670[source]
I'm deliberately using SQLite here because my use-case is read-only. https://fivethirtyeight.datasettes.com/ is a demo that I've been running on Heroku for over a year now - the trick is that if your data never changes you can package up the SQLite .db file as part of the deployment.