diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index a028e542629..f38334a8fe7 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,6 +1,19 @@ #!/bin/bash echo $(pwd) +# Copy pre-cached Prisma binaries to writable location for read-only filesystem environments (AKS, etc.) +if [ -d "/app/.cache/prisma-python/binaries" ] && [ ! -d "/tmp/.cache/prisma-python/binaries" ]; then + echo "Copying pre-cached Prisma binaries to /tmp for read-only filesystem compatibility..." + mkdir -p /tmp/.cache/prisma-python + cp -r /app/.cache/prisma-python/binaries /tmp/.cache/prisma-python/ + echo "Prisma binaries copied successfully" +fi + +# Set runtime cache locations to /tmp (writable even in read-only root filesystem) +export XDG_CACHE_HOME="${XDG_CACHE_HOME:-/tmp/.cache}" +export NPM_CONFIG_CACHE="${NPM_CONFIG_CACHE:-/tmp/npm-cache}" +export PRISMA_BINARY_CACHE_DIR="${PRISMA_BINARY_CACHE_DIR:-/tmp/.cache/prisma-python/binaries}" + # Run the Python migration script python3 litellm/proxy/prisma_migration.py diff --git a/docker/prod_entrypoint.sh b/docker/prod_entrypoint.sh index 28d1bdcc294..7c6eea6b9fb 100644 --- a/docker/prod_entrypoint.sh +++ b/docker/prod_entrypoint.sh @@ -1,5 +1,18 @@ #!/bin/sh +# Copy pre-cached Prisma binaries to writable location for read-only filesystem environments (AKS, etc.) +if [ -d "/app/.cache/prisma-python/binaries" ] && [ ! -d "/tmp/.cache/prisma-python/binaries" ]; then + echo "Copying pre-cached Prisma binaries to /tmp for read-only filesystem compatibility..." + mkdir -p /tmp/.cache/prisma-python + cp -r /app/.cache/prisma-python/binaries /tmp/.cache/prisma-python/ + echo "Prisma binaries copied successfully" +fi + +# Set runtime cache locations to /tmp (writable even in read-only root filesystem) +export XDG_CACHE_HOME="${XDG_CACHE_HOME:-/tmp/.cache}" +export NPM_CONFIG_CACHE="${NPM_CONFIG_CACHE:-/tmp/npm-cache}" +export PRISMA_BINARY_CACHE_DIR="${PRISMA_BINARY_CACHE_DIR:-/tmp/.cache/prisma-python/binaries}" + if [ "$SEPARATE_HEALTH_APP" = "1" ]; then export LITELLM_ARGS="$@" export SUPERVISORD_STOPWAITSECS="${SUPERVISORD_STOPWAITSECS:-3600}"