mirror of
https://github.com/chroma-core/chroma.git
synced 2026-10-28 17:05:07 +08:00
## Description of changes This PR unifies the 5 separate Rust Dockerfiles into 1. This results in substantially faster builds as well as being cleaner and easier to maintain. After this PR, the old Rust Dockerfiles are no longer used in this repo but I'm keeping them around until all downstream consumers are updated to use the new `rust/Dockerfile`. ## Timings I tested the difference in (local) speed with 3 scenarios. For each one, I measured the time from the start of the build to when all services in Tilt were green. | | before | after | speedup | |----------------------------------------------------|--------|-------|---------| | cold `tilt up` | 7m14s | 3m55s | 1.8x | | new comment in `rust/types/src/api_types.rs` | 2m2s | 58s | 2.1x | | new comment in `rust/garbage_collector/src/lib.rs` | 37s | 29s | 1.3x |
40 lines
1.1 KiB
YAML
40 lines
1.1 KiB
YAML
version: '3.9'
|
|
|
|
networks:
|
|
net:
|
|
driver: bridge
|
|
|
|
services:
|
|
server:
|
|
image: server
|
|
build:
|
|
context: .
|
|
dockerfile: rust/Dockerfile
|
|
target: cli
|
|
# Uncomment below to build in release mode
|
|
# args:
|
|
# RELEASE_MODE: "1"
|
|
volumes:
|
|
# The default config specifies a persist_directory of /data.
|
|
# Read more about deployments: https://docs.trychroma.com/deployment
|
|
- chroma-data:/data
|
|
environment:
|
|
- CHROMA_OPEN_TELEMETRY__ENDPOINT=${CHROMA_OPEN_TELEMETRY__ENDPOINT}
|
|
- CHROMA_OPEN_TELEMETRY__SERVICE_NAME=${CHROMA_OPEN_TELEMETRY__SERVICE_NAME}
|
|
- OTEL_EXPORTER_OTLP_HEADERS=${OTEL_EXPORTER_OTLP_HEADERS}
|
|
restart: unless-stopped # possible values are: "no", always", "on-failure", "unless-stopped"
|
|
ports:
|
|
- "8000:8000"
|
|
healthcheck:
|
|
# Adjust below to match your container port
|
|
test: [ "CMD", "curl", "-f", "http://localhost:8000/api/v2/heartbeat" ]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
networks:
|
|
- net
|
|
|
|
volumes:
|
|
chroma-data:
|
|
driver: local
|