# Setting Up Docker Container

To set the Docker container for the API Proxy, you need to provide it with a few environment variables. We highly recommend keeping these variables outside of your version control system.

{% code title="EXAMPLE DOCKER-COMPOSE.YAML" %}

```yaml
services:
  gerosense:
    image: gerosense/api-proxy:1.3.0
    env_file: .env
```

{% endcode %}

Below, is the list of supported environment variables:

| Name                                                                | Description                                                                             |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| GEROSENSE\_API\_HOST<mark style="color:red;">\*</mark>              | The API host assigned to your account                                                   |
| GEROSENSE\_API\_ACCOUNT<mark style="color:red;">\*</mark>           | Your account name                                                                       |
| GEROSENSE\_API\_ACCOUNT\_PASSWORD<mark style="color:red;">\*</mark> | Your account password                                                                   |
| JWT\_SECRET<mark style="color:red;">\*</mark>                       | Configuration for the JWT secret used to authenticate your users. See below for details |
| HOST                                                                | The host on which `api-proxy` will listen. The default is `0.0.0.0`                     |
| PORT                                                                | The port on which `api-proxy` will listen. The default is `8000`                        |

## JWT\_SECRET Configuration

`JWT_SECRET` is an JSON object with the following fields:

| Field                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| type                                     | <p>The type of your JWT secret. Don't specify it if you use <code>jwk\_url</code>.<br><br>For Firebase, don't specify it.<br>For Supabase, it's <code>HS256</code>.<br><br>Supported algorithms: <code>HS256</code>, <code>HS384</code>, <code>HS512</code>, <code>ES256</code>, <code>ES384</code>, <code>RS256</code>, <code>RS384</code>, <code>RS512</code>, <code>PS256</code>, <code>PS384</code>, <code>PS512</code>, <code>EdDSA</code>.</p>                                                                                                                                   |
| key                                      | <p>Your JWT secret key. Don't specify it if you use <code>jwk\_url</code>.<br><br>For Firebase, don't specify it.<br>For Supabase, you can find it under <code>Settings > API > JWT Secret</code>.<br><br>For other providers:<br>In the case of a symmetric key (i.e., an HMAC-based key), just the key as is. The key must be long enough for the chosen algorithm (e.g., for HS256, it must be at least 32 characters long).</p><p></p><p>In the case of an asymmetric key (RSA, EdDSA, ECDSA, etc.), only the public key is in a PEM-encoded string or as an X509 certificate.</p> |
| jwk\_url                                 | <p>JSON Web Key URL.<br><br>For Firebase, use:<br><code><https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com></code> <br><br>For Supabse, don't specify it.</p>                                                                                                                                                                                                                                                                                                                                                                                  |
| audience                                 | <p>One or multiple supported audiences.<br><br>For Firebase, use your project ID.<br>For Supabase, by default, authenticated users have <code>authenticated</code> audience.<br><br>Use an array in case you need to support multiple audiences:<br><code>\["audience1", "audience2", ...]</code></p>                                                                                                                                                                                                                                                                                  |
| issuer<mark style="color:red;">\*</mark> | <p>Issuer of the token.<br><br>For Firebase, use: <code>[https://securetoken.google.com/\&#x3C;firebase-project-id>](https://securetoken.google.com/\&#x3C;firebase-project-id>)</code><br><br>For Supabase, use:<br><code>https\://\<project-id>.supabase.co/auth/v1</code></p>                                                                                                                                                                                                                                                                                                       |

{% code title="EXAMPLE .ENV FOR FIREBASE" %}

```bash
GEROSENSE_API_HOST=https://api-b2b.gerosense.ai
GEROSENSE_API_ACCOUNT=<your-account-name>
GEROSENSE_API_ACCOUNT_PASSWORD=<your-account-password>

JWT_SECRET='{"jwk_url":"https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com","audience":"<firebase-project-id>","issuer":"https://securetoken.google.com/<firebase-project-id>"}'
```

{% endcode %}

{% code title="EXAMPLE .ENV FOR SUPABASE" %}

```bash
GEROSENSE_API_HOST=https://api-b2b.gerosense.ai
GEROSENSE_API_ACCOUNT=<your-account-name>
GEROSENSE_API_ACCOUNT_PASSWORD=<your-account-password>

JWT_SECRET='{"type":"HS256","key":"<jwt-secret-from-supabase>","audience":"authenticated","issuer":"https://<project-id>.supabase.co/auth/v1"}'
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.gerosense.ai/gerosense-api-proxy-reference/setting-up-docker-container.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
