{"html_url": "https://github.com/simonw/datasette/issues/1522#issuecomment-974542348", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1522", "id": 974542348, "node_id": "IC_kwDOBm6k_c46FlYM", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-11-19T23:41:47Z", "updated_at": "2021-11-19T23:44:07Z", "author_association": "OWNER", "body": "Do I have to use `cloudbuild.yml` to specify these? https://stackoverflow.com/a/58327340/6083 and https://stackoverflow.com/a/66232670/6083 suggest I do.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1058896236, "label": "Deploy a live instance of demos/apache-proxy"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1522#issuecomment-974541971", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1522", "id": 974541971, "node_id": "IC_kwDOBm6k_c46FlST", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-11-19T23:40:32Z", "updated_at": "2021-11-19T23:40:32Z", "author_association": "OWNER", "body": "I want to be able to use build arguments to specify which commit version or branch of Datasette to deploy.\r\n\r\nThis is proving hard to work out. I have this in my Dockerfile now:\r\n\r\n```\r\nARG DATASETTE_REF\r\n\r\nRUN pip install https://github.com/simonw/datasette/archive/${DATASETTE_REF}.zip\r\n```\r\nWhich works locally:\r\n\r\n docker build -t datasette-apache-proxy-demo . \\\r\n --build-arg DATASETTE_REF=c617e1769ea27e045b0f2907ef49a9a1244e577d\r\n\r\nBut I can't figure out the right incantation to pass to `gcloud build submit`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1058896236, "label": "Deploy a live instance of demos/apache-proxy"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1522#issuecomment-974523569", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1522", "id": 974523569, "node_id": "IC_kwDOBm6k_c46Fgyx", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-11-19T22:51:10Z", "updated_at": "2021-11-19T22:51:10Z", "author_association": "OWNER", "body": "I wan a GitHub Action which I can manually activate to deploy a new version of that demo... and I want it to bake in the latest release of Datasette so I can use it to demonstrate bug fixes.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1058896236, "label": "Deploy a live instance of demos/apache-proxy"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1522#issuecomment-974523297", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1522", "id": 974523297, "node_id": "IC_kwDOBm6k_c46Fguh", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-11-19T22:50:31Z", "updated_at": "2021-11-19T22:50:31Z", "author_association": "OWNER", "body": "Demo code is now at: https://github.com/simonw/datasette/tree/main/demos/apache-proxy", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1058896236, "label": "Deploy a live instance of demos/apache-proxy"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1522#issuecomment-974521687", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1522", "id": 974521687, "node_id": "IC_kwDOBm6k_c46FgVX", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-11-19T22:46:26Z", "updated_at": "2021-11-19T22:46:26Z", "author_association": "OWNER", "body": "Oh weird, it started working: https://datasette-apache-proxy-demo-j7hipcg4aq-uc.a.run.app/prefix/fixtures/sortable", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1058896236, "label": "Deploy a live instance of demos/apache-proxy"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1522#issuecomment-974506401", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1522", "id": 974506401, "node_id": "IC_kwDOBm6k_c46Fcmh", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-11-19T22:11:51Z", "updated_at": "2021-11-19T22:11:51Z", "author_association": "OWNER", "body": "This is frustrating: I have the following Dockerfile:\r\n```dockerfile\r\nFROM python:3-alpine\r\n\r\nRUN apk add --no-cache \\\r\n\tapache2 \\\r\n\tapache2-proxy \\\r\n\tbash\r\n\r\nRUN pip install datasette\r\n\r\nENV TINI_VERSION v0.18.0\r\nADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static /tini\r\nRUN chmod +x /tini\r\n\r\n# Append this to the end of the default httpd.conf file\r\nRUN echo $'ServerName localhost\\n\\\r\n\\n\\\r\n\\n\\\r\n Order deny,allow\\n\\\r\n Allow from all\\n\\\r\n\\n\\\r\n\\n\\\r\nProxyPass /prefix/ http://localhost:8001/\\n\\\r\nHeader add X-Proxied-By \"Apache2\"' >> /etc/apache2/httpd.conf\r\n\r\nRUN echo $'Datasette' > /var/www/localhost/htdocs/index.html\r\n\r\nWORKDIR /app\r\n\r\nADD https://latest.datasette.io/fixtures.db /app/fixtures.db\r\n\r\nRUN echo $'#!/usr/bin/env bash\\n\\\r\nset -e\\n\\\r\n\\n\\\r\nhttpd -D FOREGROUND &\\n\\\r\ndatasette fixtures.db --setting base_url \"/prefix/\" -h 0.0.0.0 -p 8001 &\\n\\\r\n\\n\\\r\nwait -n' > /app/start.sh\r\n\r\nRUN chmod +x /app/start.sh\r\n\r\nEXPOSE 80\r\nENTRYPOINT [\"/tini\", \"--\", \"/app/start.sh\"]\r\n```\r\nIt works fine when I run it locally:\r\n```\r\ndocker build -t datasette-apache-proxy-demo .\r\ndocker run -p 5000:80 datasette-apache-proxy-demo\r\n```\r\nBut when I deploy it to Cloud Run with the following script:\r\n```bash\r\n#!/bin/bash\r\n# https://til.simonwillison.net/cloudrun/ship-dockerfile-to-cloud-run\r\n\r\nNAME=\"datasette-apache-proxy-demo\"\r\nPROJECT=$(gcloud config get-value project)\r\nIMAGE=\"gcr.io/$PROJECT/$NAME\"\r\n\r\ngcloud builds submit --tag $IMAGE\r\ngcloud run deploy \\\r\n --allow-unauthenticated \\\r\n --platform=managed \\\r\n --image $IMAGE $NAME \\\r\n --port 80\r\n```\r\nIt serves the `/` page successfully, but hits to `/prefix/` return the following 503 error:\r\n\r\n> Service Unavailable\r\n>\r\n> The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.\r\n>\r\n> Apache/2.4.51 (Unix) Server at datasette-apache-proxy-demo-j7hipcg4aq-uc.a.run.app Port 80\r\n\r\nCloud Run logs:\r\n\r\n\"Screen\r\n\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1058896236, "label": "Deploy a live instance of demos/apache-proxy"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1522#issuecomment-974435661", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1522", "id": 974435661, "node_id": "IC_kwDOBm6k_c46FLVN", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-11-19T20:33:42Z", "updated_at": "2021-11-19T20:33:42Z", "author_association": "OWNER", "body": "Should just be a case of deploying this `Dockerfile`:\r\n\r\n```Dockerfile\r\nFROM python:3-alpine\r\n\r\nRUN apk add --no-cache \\\r\n\tapache2 \\\r\n\tapache2-proxy \\\r\n\tbash\r\n\r\nRUN pip install datasette\r\n\r\nENV TINI_VERSION v0.18.0\r\nADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static /tini\r\nRUN chmod +x /tini\r\n\r\n# Append this to the end of the default httpd.conf file\r\nRUN echo $'ServerName localhost\\n\\\r\n\\n\\\r\n\\n\\\r\n Order deny,allow\\n\\\r\n Allow from all\\n\\\r\n\\n\\\r\n\\n\\\r\nProxyPass /foo/bar/ http://localhost:9000/\\n\\\r\nHeader add X-Proxied-By \"Apache2\"' >> /etc/apache2/httpd.conf\r\n\r\nRUN echo $'Datasette' > /var/www/localhost/htdocs/index.html\r\n\r\nWORKDIR /app\r\n\r\nADD https://latest.datasette.io/fixtures.db /app/fixtures.db\r\n\r\nRUN echo $'#!/usr/bin/env bash\\n\\\r\nset -e\\n\\\r\n\\n\\\r\nhttpd -D FOREGROUND &\\n\\\r\ndatasette fixtures.db --setting base_url \"/foo/bar/\" -p 9000 &\\n\\\r\n\\n\\\r\nwait -n' > /app/start.sh\r\n\r\nRUN chmod +x /app/start.sh\r\n\r\nEXPOSE 80\r\nENTRYPOINT [\"/tini\", \"--\", \"/app/start.sh\"]\r\n```\r\nI can follow this TIL: https://til.simonwillison.net/cloudrun/ship-dockerfile-to-cloud-run", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1058896236, "label": "Deploy a live instance of demos/apache-proxy"}, "performed_via_github_app": null}