mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Switch to hosting demo on Fly, closes #1522
This commit is contained in:
parent
494f11d5cc
commit
48951e4304
4 changed files with 90 additions and 31 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
See also [Running Datasette behind a proxy](https://docs.datasette.io/en/latest/deploying.html#running-datasette-behind-a-proxy)
|
See also [Running Datasette behind a proxy](https://docs.datasette.io/en/latest/deploying.html#running-datasette-behind-a-proxy)
|
||||||
|
|
||||||
This live demo is running at https://apache-proxy-demo.datasette.io/
|
This live demo is running at https://datasette-apache-proxy-demo.fly.dev/prefix/
|
||||||
|
|
||||||
To build locally, passing in a Datasette commit hash (or `main` for the main branch):
|
To build locally, passing in a Datasette commit hash (or `main` for the main branch):
|
||||||
|
|
||||||
|
|
@ -14,3 +14,25 @@ Then run it like this:
|
||||||
docker run -p 5000:80 datasette-apache-proxy-demo
|
docker run -p 5000:80 datasette-apache-proxy-demo
|
||||||
|
|
||||||
And visit `http://localhost:5000/` or `http://localhost:5000/prefix/`
|
And visit `http://localhost:5000/` or `http://localhost:5000/prefix/`
|
||||||
|
|
||||||
|
## Deployment to Fly
|
||||||
|
|
||||||
|
To deploy to [Fly](https://fly.io/) first create an application there by running:
|
||||||
|
|
||||||
|
flyctl apps create --name datasette-apache-proxy-demo
|
||||||
|
|
||||||
|
You will need a different name, since I have already taken that one.
|
||||||
|
|
||||||
|
Then run this command to deploy:
|
||||||
|
|
||||||
|
flyctl deploy --build-arg DATASETTE_REF=main
|
||||||
|
|
||||||
|
This uses `fly.toml` in this directory, which hard-codes the `datasette-apache-proxy-demo` name - so you would need to edit that file to match your application name before running this.
|
||||||
|
|
||||||
|
## Deployment to Cloud Run
|
||||||
|
|
||||||
|
Deployments to Cloud Run currently result in intermittent 503 errors and I'm not sure why, see [issue #1522](https://github.com/simonw/datasette/issues/1522).
|
||||||
|
|
||||||
|
You can deploy like this:
|
||||||
|
|
||||||
|
DATASETTE_REF=main ./deploy-to-cloud-run.sh
|
||||||
|
|
|
||||||
37
demos/apache-proxy/fly.toml
Normal file
37
demos/apache-proxy/fly.toml
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
app = "datasette-apache-proxy-demo"
|
||||||
|
|
||||||
|
kill_signal = "SIGINT"
|
||||||
|
kill_timeout = 5
|
||||||
|
processes = []
|
||||||
|
|
||||||
|
[env]
|
||||||
|
|
||||||
|
[experimental]
|
||||||
|
allowed_public_ports = []
|
||||||
|
auto_rollback = true
|
||||||
|
|
||||||
|
[[services]]
|
||||||
|
http_checks = []
|
||||||
|
internal_port = 80
|
||||||
|
processes = ["app"]
|
||||||
|
protocol = "tcp"
|
||||||
|
script_checks = []
|
||||||
|
|
||||||
|
[services.concurrency]
|
||||||
|
hard_limit = 25
|
||||||
|
soft_limit = 20
|
||||||
|
type = "connections"
|
||||||
|
|
||||||
|
[[services.ports]]
|
||||||
|
handlers = ["http"]
|
||||||
|
port = 80
|
||||||
|
|
||||||
|
[[services.ports]]
|
||||||
|
handlers = ["tls", "http"]
|
||||||
|
port = 443
|
||||||
|
|
||||||
|
[[services.tcp_checks]]
|
||||||
|
grace_period = "1s"
|
||||||
|
interval = "15s"
|
||||||
|
restart_limit = 0
|
||||||
|
timeout = "2s"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue