{"html_url": "https://github.com/simonw/datasette/pull/1574#issuecomment-1105464661", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1574", "id": 1105464661, "node_id": "IC_kwDOBm6k_c5B5A1V", "user": {"value": 208018, "label": "dholth"}, "created_at": "2022-04-21T16:51:24Z", "updated_at": "2022-04-21T16:51:24Z", "author_association": "NONE", "body": "tfw you have more ephemeral storage than upstream bandwidth\r\n\r\n```\r\nFROM python:3.10-slim AS base\r\n\r\nRUN apt update && apt -y install zstd\r\n\r\nENV DATASETTE_SECRET 'sosecret'\r\nRUN --mount=type=cache,target=/root/.cache/pip\r\n pip install -U datasette datasette-pretty-json datasette-graphql\r\n\r\nENV PORT 8080\r\nEXPOSE 8080\r\n\r\nFROM base AS pack\r\n\r\nCOPY . /app\r\nWORKDIR /app\r\n\r\nRUN datasette inspect --inspect-file inspect-data.json\r\nRUN zstd --rm *.db\r\n\r\nFROM base AS unpack\r\n\r\nCOPY --from=pack /app /app\r\nWORKDIR /app\r\n\r\nCMD [\"/bin/bash\", \"-c\", \"shopt -s nullglob && zstd --rm -d *.db.zst && datasette serve --host 0.0.0.0 --cors --inspect-file inspect-data.json --metadata metadata.json --create --port $PORT *.db\"]\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1084193403, "label": "introduce new option for datasette package to use a slim base image"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1634#issuecomment-1065334891", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1634", "id": 1065334891, "node_id": "IC_kwDOBm6k_c4_f7hr", "user": {"value": 208018, "label": "dholth"}, "created_at": "2022-03-11T17:38:08Z", "updated_at": "2022-03-11T17:38:08Z", "author_association": "NONE", "body": "I noticed the image was large when using fly. Is it possible to use a -slim base?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1131295060, "label": "Update Dockerfile generated by `datasette publish`"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/327#issuecomment-1043626870", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/327", "id": 1043626870, "node_id": "IC_kwDOBm6k_c4-NHt2", "user": {"value": 208018, "label": "dholth"}, "created_at": "2022-02-17T23:37:24Z", "updated_at": "2022-02-17T23:37:24Z", "author_association": "NONE", "body": "On second thought any kind of quick-to-decompress-on-startup could be helpful if we're paying for the container registry and deployment bandwidth but not ephemeral storage.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 335200136, "label": "Explore if SquashFS can be used to shrink size of packaged Docker containers"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/327#issuecomment-1043609198", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/327", "id": 1043609198, "node_id": "IC_kwDOBm6k_c4-NDZu", "user": {"value": 208018, "label": "dholth"}, "created_at": "2022-02-17T23:21:36Z", "updated_at": "2022-02-17T23:33:01Z", "author_association": "NONE", "body": "On fly.io. This particular database goes from 1.4GB to 200M. Slower, part of that might be having no `--inspect-file`?\r\n\r\n```\r\n$ datasette publish fly ... --generate-dir /tmp/deploy-this\r\n...\r\n$ mksquashfs large.db large.squashfs\r\n$ rm large.db # don't accidentally put it in the image\r\n$ cat Dockerfile\r\nFROM python:3.8\r\nCOPY . /app\r\nWORKDIR /app\r\n\r\nENV DATASETTE_SECRET 'xyzzy'\r\nRUN pip install -U datasette\r\n# RUN datasette inspect large.db --inspect-file inspect-data.json\r\nENV PORT 8080\r\nEXPOSE 8080\r\nCMD mount -o loop -t squashfs large.squashfs /mnt; datasette serve --host 0.0.0.0 -i /mnt/large.db --cors --port $PORT\r\n```\r\n\r\nIt would also be possible to copy the file onto the ~6GB available on the ephemeral container filesystem on startup. A little against the spirit of the thing? On this example the whole docker image is 2.42 GB and the squashfs version is 1.14 GB.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 335200136, "label": "Explore if SquashFS can be used to shrink size of packaged Docker containers"}, "performed_via_github_app": null}