chroma
chroma copied to clipboard
Fix docker compose persistence issue and use multistage builder pattern to shrink chroma docker image
Description of changes
Clickhouse data was being saved in an anonymous volume. Anonymous volumes are not removed by default. However, as they don’t have a stable name, they will not be automatically mounted by a subsequent docker compose up. For data that needs to persist between updates, use explicit paths as bind mounts or named volumes.
https://docs.docker.com/engine/reference/commandline/compose_down/#usage
The yaml in the repo makes it look like clickhouse_data:/bitnami/clickhouse is where the data is supposed to go but that isn't what's happening.
Modified Dockerfile to use multistage builder pattern to shrink the docker image. The new image is 800MB smaller than the official chroma image.
Test plan
Build image locally. Unit tests all passed. Data persists after bringing compose stack down and up. No actual chroma code change in this PR.

Documentation Changes
None required.