Skip to content

Commit

Permalink
docs: update self-hosted API Docker command example
Browse files Browse the repository at this point in the history
  • Loading branch information
mtth committed Dec 1, 2024
1 parent fbd6b45 commit 8d3da0f
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions resources/guides/using-a-self-hosted-api-server.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,10 @@
"\n",
"### From the Docker image\n",
"\n",
"Alternatively, you can download and run the [`opvious/api-server`](https://hub.docker.com/r/opvious/api-server) Docker image directly. This allows you to use it with your own database and/or cache:\n",
"Alternatively, you can download and run the [`opvious/api-server`](https://hub.docker.com/r/opvious/api-server) Docker image directly:\n",
"\n",
"```\n",
"docker run -p 8080:8080 \\\n",
" -e DB_URL=postgres:// \\\n",
" -e REDIS_URL=redis:// \\\n",
" -e OPVIOUS_API_IMAGE_EULA \\\n",
" opvious/api-server\n",
"docker run -p 8080:8080 opvious/api-server\n",
"```\n",
"\n",
"Refer to the image's documentation for more information.\n",
Expand All @@ -55,18 +51,7 @@
"profiles:\n",
" - name: local\n",
" endpoint: http://localhost:8080\n",
"```\n",
"\n",
"\n",
"## Authenticating requests\n",
"\n",
"The server's `STATIC_TOKENS` environment variable is used to specify a comma-separated list of static API tokens for authenticating API requests. Each entry's format is `<email>=<token>`, where `<email>` is the associated account's email. When using the CLI, this variable is set with the `-t` option:\n",
"\n",
"```sh\n",
"opvious api start -t [email protected]=secret-token\n",
"```\n",
"\n",
"These tokens can then be used as regular API tokens in SDKs by prefixing them with `static:`. For example requests to the server started with the command just above can be authenticated as `[email protected]` by setting `OPVIOUS_TOKEN=static:secret-token`."
"```"
]
},
{
Expand Down Expand Up @@ -94,7 +79,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.5"
"version": "3.12.7"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 8d3da0f

Please sign in to comment.