tabledog / datasette-stripe

A web SQL interface to your Stripe account using Datasette.
https://table.dog
MIT License
20 stars 2 forks source link

Suggestion for "Docker Run" section of README #1

Open qbatten opened 2 years ago

qbatten commented 2 years ago

This is an awesome project, thanks for creating it!

Summary

I ran into some small confusion when trying to run it locally and wanted to share my solutions and maybe add a few sentences to the documentation.

Below I'll discuss the details of the docker command issue. I'll also push a PR that makes these little changes to the README. If you're not taking contributions right now I totally understand, just figured I'd throw it out there in case it's useful. Again, this project is awesome!

Details of the docker run cmd issue

Here's the message I got when entering that docker cmd:

datasette-stripe on  master [!?]
❯ docker run -it -e NODE_ENV='development' -e STRIPE_SECRET_KEY='rk_test...' -v /host/data:/data -p 3000:3000 datasette-stripe
docker: Error response from daemon: Mounts denied:
The path /host/data is not shared from the host and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
See https://docs.docker.com/desktop/mac for more info.

I tried adding the host & host/data folders in File Sharing, as suggested by the error message, but that didn't resolve. Eventually I figured out that passing an absolute path to the -v flag resolved the issue. So the new version of the command that I propose is: docker run -it -e NODE_ENV='development' -e STRIPE_SECRET_KEY='rk_test...' -v `pwd`/host/data:/data -p 3000:3000 datasette-stripe. This expands pwd and results in an absolute path.

qbatten commented 2 years ago

Oh I don't have perms to PR. Here's my amended version of the Docker Run section of the README:

Run a local copy with these commands:

You will now have:

Go to http://127.0.0.1:3000, where you'll be prompted for a login. Enter your Stripe API key in the username field and leave the password field blank. Now you should be able to view the Datasette UI!

Note: Populating the database may take a while because of Stripe's API rate limits. You can watch the tdog logs as it fetches your data at /host/data/logs/tdog.txt.