mirror of
https://github.com/placeholder-soft/chroma.git
synced 2026-04-30 04:45:01 +08:00
Fix docker compose persistence issue and use multistage builder pattern to shrink chroma docker image (#456)
## 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. --------- Co-authored-by: perry <perryaws2021@protonmail.com> Co-authored-by: Jeffrey Huber <jeff@trychroma.com>
This commit is contained in:
@@ -6,6 +6,7 @@ networks:
|
||||
|
||||
services:
|
||||
server:
|
||||
image: server
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
@@ -34,7 +35,8 @@ services:
|
||||
- '8123:8123'
|
||||
- '9000:9000'
|
||||
volumes:
|
||||
- clickhouse_data:/bitnami/clickhouse
|
||||
- clickhouse_data:/var/lib/clickhouse
|
||||
- clickhouse_logs:/var/log/clickhouse-server
|
||||
- backups:/backups
|
||||
- ./config/backup_disk.xml:/etc/clickhouse-server/config.d/backup_disk.xml
|
||||
- ./config/chroma_users.xml:/etc/clickhouse-server/users.d/chroma.xml
|
||||
@@ -44,6 +46,8 @@ services:
|
||||
volumes:
|
||||
clickhouse_data:
|
||||
driver: local
|
||||
clickhouse_logs:
|
||||
driver: local
|
||||
index_data:
|
||||
driver: local
|
||||
backups:
|
||||
|
||||
Reference in New Issue
Block a user