Skip to content

Commit

Permalink
[ENH]: Docker compose data volume (#1119)
Browse files Browse the repository at this point in the history
## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
- Added persistent volume in all docker compose files. The advantage is
that by default user's data is not lost when `docker compose down` is
executed unless `--volume` is provided. This gives a default behaviour
that is non-destructive towards user data.

## Test plan
*How are these changes tested?*

- [x] Tests pass locally with `pytest` for python, `yarn test` for js

## Documentation Changes
N/A
  • Loading branch information
tazarov authored Dec 6, 2023
1 parent 6f7fed0 commit eea76bf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
8 changes: 4 additions & 4 deletions docker-compose.server.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ networks:
services:
server:
image: ghcr.io/chroma-core/chroma:latest
environment:
- IS_PERSISTENT=TRUE
volumes:
# Default configuration for persist_directory in chromadb/config.py
# Currently it's located in "/chroma/chroma/"
- chroma_persistent_folder:/chroma/chroma/
- chroma-data:/chroma/chroma/
ports:
- 8000:8000
networks:
- net

volumes:
backups:
driver: local
chroma_persistent_folder:
chroma-data:
driver: local
7 changes: 2 additions & 5 deletions docker-compose.test-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ services:
context: .
dockerfile: Dockerfile
volumes:
- ./:/chroma
- test_index_data:/index_data
- chroma-data:/chroma/chroma
command: uvicorn chromadb.app:app --workers 1 --host 0.0.0.0 --port 8000 --log-config chromadb/log_config.yml --timeout-keep-alive 30
environment:
- ANONYMIZED_TELEMETRY=False
Expand All @@ -28,7 +27,5 @@ services:
- test_net

volumes:
test_index_data:
driver: local
test_backups:
chroma-data:
driver: local
7 changes: 2 additions & 5 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ services:
context: .
dockerfile: Dockerfile
volumes:
- ./:/chroma
- test_index_data:/index_data
- chroma-data:/chroma/chroma
command: uvicorn chromadb.app:app --workers 1 --host 0.0.0.0 --port 8000 --log-config chromadb/log_config.yml --timeout-keep-alive 30
environment:
- ANONYMIZED_TELEMETRY=False
Expand All @@ -23,7 +22,5 @@ services:
- test_net

volumes:
test_index_data:
driver: local
test_backups:
chroma-data:
driver: local
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ services:
context: .
dockerfile: Dockerfile
volumes:
- ./:/chroma
# Be aware that indexed data are located in "/chroma/chroma/"
# Default configuration for persist_directory in chromadb/config.py
# Read more about deployments: https://docs.trychroma.com/deployment
- chroma-data:/chroma/chroma
command: uvicorn chromadb.app:app --reload --workers 1 --host 0.0.0.0 --port 8000 --log-config chromadb/log_config.yml --timeout-keep-alive 30
environment:
- IS_PERSISTENT=TRUE
Expand All @@ -33,5 +34,5 @@ services:
- net

volumes:
backups:
chroma-data:
driver: local

0 comments on commit eea76bf

Please sign in to comment.