{"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-504661909", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 504661909, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY2MTkwOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-06-22T12:29:46Z", "updated_at": "2019-06-22T12:29:46Z", "author_association": "OWNER", "body": "I'm still trying to figure this out myself.\r\n\r\nI'm confident that running nginx on port 80 and using it to proxy traffic to Datasette is a sensible way to solve the port problem.\r\n\r\nAs for running Datasette itself: the two options that seem best to me are some kind of Init.d service or running it under supervisord. I have to admit I haven't worked out the necessary incantation for either of those yet: the solitary instance I have that's not running as a Docker container is sitting in a \"screen\" instance for the moment!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-504661990", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 504661990, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY2MTk5MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-06-22T12:30:47Z", "updated_at": "2019-06-22T12:30:47Z", "author_association": "OWNER", "body": "A section in the Datasette docs that acts as recommendations plus a tutorial for running Datasette on a VPS without using a Docker would be excellent.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-504662063", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 504662063, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY2MjA2Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-06-22T12:31:58Z", "updated_at": "2019-06-22T12:31:58Z", "author_association": "OWNER", "body": "This is also relevant to Datasette Library #417 ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-504662904", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 504662904, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY2MjkwNA==", "user": {"value": 45057, "label": "russss"}, "created_at": "2019-06-22T12:45:21Z", "updated_at": "2019-06-22T12:45:39Z", "author_association": "CONTRIBUTOR", "body": "On most modern Linux distros, systemd is the easiest answer.\r\n\r\nExample systemd unit file (save to `/etc/systemd/system/datasette.service`):\r\n```\r\n[Unit]\r\nDescription=Datasette\r\nAfter=network.target\r\n\r\n[Service]\r\nType=simple\r\nUser=\r\nWorkingDirectory=/path/to/data\r\nExecStart=/path/to/datasette serve -h 0.0.0.0 ./my.db\r\nRestart=on-failure\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n```\r\n\r\nActivate it with:\r\n```bash\r\n$ sudo systemctl daemon-reload\r\n$ sudo systemctl enable datasette\r\n$ sudo systemctl start datasette\r\n```\r\n\r\nLogs are best viewed using `journalctl -u datasette -f`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-504662931", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 504662931, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY2MjkzMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-06-22T12:45:47Z", "updated_at": "2019-06-22T12:45:47Z", "author_association": "OWNER", "body": "I asked about this on Twitter and got a solid recommendation for systemd and this tutorial: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units - via https://twitter.com/sil/status/1142412145990221825", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-504662987", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 504662987, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY2Mjk4Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-06-22T12:46:39Z", "updated_at": "2019-06-22T12:46:39Z", "author_association": "OWNER", "body": "... and @russss also suggested systemd 21 seconds before I posted that!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-504663201", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 504663201, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY2MzIwMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-06-22T12:49:56Z", "updated_at": "2019-06-22T12:49:56Z", "author_association": "OWNER", "body": "Here are some partial notes I have saved from an nginx configuration I've used in the past:\r\n```\r\ncat /etc/nginx/sites-available/default\r\nserver {\r\n\tlisten 80 default_server;\r\n\tlisten [::]:80 default_server;\r\n\r\n location / {\r\n proxy_pass http://127.0.0.1:8001/;\r\n\t\tproxy_set_header Host $host;\r\n }\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": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-504663390", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 504663390, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY2MzM5MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-06-22T12:52:27Z", "updated_at": "2019-06-22T12:52:27Z", "author_association": "OWNER", "body": "This example is useful to - I like how it has a Makefile that knows how to set up systemd: https://github.com/pikesley/Queube", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-504663766", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 504663766, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY2Mzc2Ng==", "user": {"value": 45057, "label": "russss"}, "created_at": "2019-06-22T12:57:59Z", "updated_at": "2019-06-22T12:57:59Z", "author_association": "CONTRIBUTOR", "body": "> This example is useful to - I like how it has a Makefile that knows how to set up systemd: https://github.com/pikesley/Queube\r\n\r\nI wasn't even aware it was possible to add a systemd service at an arbitrary path, but it seems a little messy to me.\r\n\r\nMaybe worth noting that systemd does support [per-user services](https://wiki.archlinux.org/index.php/Systemd/User) which don't require root access. Cool but probably overkill for most people (especially when you're going to need root to listen on port 80 anyway, directly or via a reverse proxy).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-504684709", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 504684709, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY4NDcwOQ==", "user": {"value": 7936571, "label": "chrismp"}, "created_at": "2019-06-22T17:36:25Z", "updated_at": "2019-06-22T17:36:25Z", "author_association": "NONE", "body": "> WorkingDirectory=/path/to/data\r\n\r\n@russss, Which directory does this represent?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-504684831", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 504684831, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY4NDgzMQ==", "user": {"value": 45057, "label": "russss"}, "created_at": "2019-06-22T17:38:23Z", "updated_at": "2019-06-22T17:38:23Z", "author_association": "CONTRIBUTOR", "body": "> > WorkingDirectory=/path/to/data\r\n> \r\n> @russss, Which directory does this represent?\r\n\r\nIt's the working directory (cwd) of the spawned process. In this case if you set it to the directory your data is in, you can use relative paths to the db (and metadata/templates/etc) in the `ExecStart` command.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-504685187", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 504685187, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY4NTE4Nw==", "user": {"value": 7936571, "label": "chrismp"}, "created_at": "2019-06-22T17:43:24Z", "updated_at": "2019-06-22T17:43:24Z", "author_association": "NONE", "body": "> > > WorkingDirectory=/path/to/data\r\n> > \r\n> > \r\n> > @russss, Which directory does this represent?\r\n> \r\n> It's the working directory (cwd) of the spawned process. In this case if you set it to the directory your data is in, you can use relative paths to the db (and metadata/templates/etc) in the `ExecStart` command.\r\n\r\nIn my case, on a remote server, I set up a virtual environment in `/home/chris/Env/datasette`, and when I activated that environment I ran `pip install datasette`. \r\n\r\nMy datasette project is in `/home/chris/datatsette-project`, so I guess I'd use that directory in the `WorkingDirectory` parameter?\r\n\r\nAnd the `ExecStart` parameter would be `/home/chris/Env/datasette/lib/python3.7/site-packages/datasette serve -h 0.0.0.0 my.db` I'm guessing?\r\n ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-504690927", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 504690927, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY5MDkyNw==", "user": {"value": 45057, "label": "russss"}, "created_at": "2019-06-22T19:06:07Z", "updated_at": "2019-06-22T19:06:07Z", "author_association": "CONTRIBUTOR", "body": "I'd rather not turn this into a systemd support thread, but you're trying to execute the package directory there. Your datasette executable is probably at `/home/chris/Env/datasette/bin/datasette`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/516#issuecomment-504696610", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/516", "id": 504696610, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY5NjYxMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-06-22T20:36:57Z", "updated_at": "2019-06-22T20:36:57Z", "author_association": "OWNER", "body": "According to [the black documentation](https://black.readthedocs.io/en/stable/the_black_code_style.html?highlight=isort.cfg) the following config file is necessary to avoid isort and black getting into an edit war with each other:\r\n```\r\n[settings]\r\nmulti_line_output=3\r\ninclude_trailing_comma=True\r\nforce_grid_wrap=0\r\nuse_parentheses=True\r\nline_length=88\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459509126, "label": "Enforce import sort order with isort"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/516#issuecomment-504696638", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/516", "id": 504696638, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY5NjYzOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-06-22T20:37:25Z", "updated_at": "2019-06-22T20:38:42Z", "author_association": "OWNER", "body": "This test added do `test_black.py` seems to do the trick:\r\n```python\r\n@pytest.mark.parametrize(\"path\", code_root.glob(\"**/*.py\"))\r\ndef test_isort(path):\r\n # Have to capture stdout because isort uses print() directly\r\n stdout = sys.stdout\r\n sys.stdout = io.StringIO()\r\n result = isort.SortImports(path, check=True)\r\n assert (\r\n not result.incorrectly_sorted\r\n ), \"{} has incorrectly sorted imports, fix with 'isort -rc . && black .'\"\r\n sys.stdout = stdout\r\n```\r\nI'll rename `test_black.py` to `test_lint.py` to reflect that it now covers more forms of linting.\r\n\r\nAlso needed: add `move_to_front(items, \"test_isort\")` to `conftest.py`. And add `isort` to `extras_require` in `setup.py`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459509126, "label": "Enforce import sort order with isort"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/516#issuecomment-504697187", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/516", "id": 504697187, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY5NzE4Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-06-22T20:46:35Z", "updated_at": "2019-06-22T20:46:35Z", "author_association": "OWNER", "body": "I'm going to resist the temptation to do this until I've merged the `asgi` branch from #272 ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459509126, "label": "Enforce import sort order with isort"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/272#issuecomment-504697742", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/272", "id": 504697742, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY5Nzc0Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-06-22T20:55:59Z", "updated_at": "2019-06-22T20:56:22Z", "author_association": "OWNER", "body": "Getting this to work with both Sanic AND ASGI at the same time (via the classes described previously with an `--asgi` command-line option) is proving way trickier than I expected, mainly because of the complexity of [the current Datasette.app() method](https://github.com/simonw/datasette/blob/35429f90894321eda7f2db31b9ea7976f31f73ac/datasette/app.py#L545-L721).\r\n\r\nI'm going to drop the compatibility path for a bit and see if I can make progress on a pure-ASGI port.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 324188953, "label": "Port Datasette to ASGI"}, "performed_via_github_app": null}