Spaces:
Running
Running
Download docker-entrypoint.sh from Sdm0/opencodereview: direct link, hf CLI and curl.
- Browser
- Download file 919 Bytes
-
https://huggingface.co/spaces/Sdm0/opencodereview/resolve/main/docker-entrypoint.sh
- Command line
-
hf download hf://spaces/Sdm0/opencodereview/docker-entrypoint.sh
-
curl -L -o docker-entrypoint.sh https://huggingface.co/spaces/Sdm0/opencodereview/resolve/main/docker-entrypoint.sh
919 Bytes
| # ============================================================================= | |
| # OpenCodeReview — Docker Entrypoint | |
| # ============================================================================= | |
| # Runs as root to ensure the ChromaDB vector store directory is writable by | |
| # the non-root appuser (uid 1000). Then drops privileges and execs the CMD. | |
| # | |
| # This fixes the "unable to open database file" error that occurs when a | |
| # Docker named volume (owned by root) is mounted at /tmp/opencodereview_vectors | |
| # and the app runs as a non-root user. | |
| # ============================================================================= | |
| set -e | |
| VECTOR_DIR="/tmp/opencodereview_vectors" | |
| # Ensure the vector store directory exists and is writable by appuser | |
| mkdir -p "$VECTOR_DIR" | |
| chown -R appuser:appuser "$VECTOR_DIR" | |
| # Drop privileges to appuser and execute the main command | |
| exec su -s /bin/sh appuser -c "exec $*" | |