File layout impractical for docker use with bind mounts
agross opened this issue · comments
The current docker-compose.yaml included in the project will put all expensive data in the container's writable layer which gets destroyed when the container is reconfigured or rebuilt. So I tried to find a setup that persists expensive-to-create data outside
A container configured as follows won't start up since you cannot have docker create files. 0-byte files won't be accepted by the app (for e.g. faiss_index.bin
).
name: immich-duplicate-finder
services:
app:
ports:
- 127.0.0.1:8501:8501
build:
dockerfile: ./Dockerfile
stop_grace_period: 2s
volumes:
- ../duplicates.db:/immich_duplicate_finder/duplicates.db
- ../settings.db:/immich_duplicate_finder/settings.db
- ../processed_assets.db:/immich_duplicate_finder/processed_assets.db
- ../faiss_index.bin:/immich_duplicate_finder/faiss_index.bin
- ../metadata.npy:/immich_duplicate_finder/metadata.npy
- ../cache:/root/.cache/torch/
The solution is to put all permanent data files currently in /immich_duplicate_finder
in a directory and have a single bind-mount.