Skip to content

Commit

Permalink
feat: Adding docker compose examples for auth
Browse files Browse the repository at this point in the history
  • Loading branch information
tazarov committed Aug 28, 2024
1 parent cb10370 commit 84cb74b
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions docs/security/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,39 @@ Running the server:
chromadb/chroma:latest
```

=== "Docker Compose"

Create a `docker-compose.yaml` with the following content:

```yaml
networks:
net:
driver: bridge
services:
chromadb:
image: chromadb/chroma:latest
volumes:
- ./chromadb:/chroma/chroma
- ./server.htpasswd:/chroma/server.htpasswd
environment:
- IS_PERSISTENT=TRUE
- PERSIST_DIRECTORY=/chroma/chroma # this is the default path, change it as needed
- ANONYMIZED_TELEMETRY=${ANONYMIZED_TELEMETRY:-TRUE}
- CHROMA_SERVER_AUTHN_CREDENTIALS_FILE=server.htpasswd
- CHROMA_SERVER_AUTHN_PROVIDER=chromadb.auth.basic_authn.BasicAuthenticationServerProvider
ports:
- 8000:8000
networks:
- net
```

Run the following command to start the Chroma server:

```bash
docker compose -f docker-compose.yaml up -d
```


??? info "Is my config right?"

If you have correctly configured the server you should see the following line in the server logs:
Expand Down Expand Up @@ -130,6 +163,39 @@ Running the server:
chromadb/chroma:latest
```

=== "Docker Compose"

Create a `docker-compose.yaml` with the following content:

```yaml
networks:
net:
driver: bridge
services:
chromadb:
image: chromadb/chroma:latest
volumes:
- ./chromadb:/chroma/chroma
- ./server.htpasswd:/chroma/server.htpasswd
environment:
- IS_PERSISTENT=TRUE
- PERSIST_DIRECTORY=/chroma/chroma # this is the default path, change it as needed
- ANONYMIZED_TELEMETRY=${ANONYMIZED_TELEMETRY:-TRUE}
- CHROMA_SERVER_AUTHN_CREDENTIALS="chr0ma-t0k3n"
- CHROMA_AUTH_TOKEN_TRANSPORT_HEADER="Authorization"
- CHROMA_SERVER_AUTHN_PROVIDER=chromadb.auth.token_authn.TokenAuthenticationServerProvider
ports:
- 8000:8000
networks:
- net
```

Run the following command to start the Chroma server:

```bash
docker compose -f docker-compose.yaml up -d
```

??? info "Is my config right?"

If you have correctly configured the server you should see the following line in the server logs:
Expand Down

0 comments on commit 84cb74b

Please sign in to comment.