←back to thread

DigitalOcean App Platform

(pages.news.digitalocean.com)
646 points digianarchist | 3 comments | | HN request time: 0s | 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 #
1. 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 #
2. lolinder ◴[] No.24708312[source]
Please avoid prescribing best practices without understanding the architecture OP is working with.

First, you don't actually know that using SQLite would make the OP's app stateful—if datasette is set up in immutable mode, then the .db files are no more indicative of a stateful process than a static CSV or a JSON or YAML config.

Second, not every app needs to be a 12 factor app, and you're not in a position to understand the trade-offs OP is dealing with. "Best practices" rarely are best in every circumstance, and often conflict.

3. 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.