wip storage workarounds

This commit is contained in:
timothycarambat 2023-12-19 11:02:50 -08:00
parent 491b8391db
commit ade82f5776
3 changed files with 9 additions and 12 deletions

View File

@ -2,13 +2,13 @@
# This is the entrypoint for Render.com docker builds. Do not use for targeting # This is the entrypoint for Render.com docker builds. Do not use for targeting
# in other service docker builds # in other service docker builds
if test -f "$STORAGE_DIR/.env"; then # Copy pre-built assets into storage dir.
export $(xargs < "$STORAGE_DIR/.env") cp -r /app/server/storage/assets/ "$STORAGE_DIR/assets"
echo $STORAGE_DIR mkdir -p "$STORAGE_DIR/documents"
mkdir -p "$STORAGE_DIR/models"
# Copy pre-built assets into storage dir. mkdir -p "$STORAGE_DIR/vector-cache"
cp -r /app/server/storage/assets/ "$STORAGE_DIR/assets" mkdir -p "$STORAGE_DIR/assets"
fi touch "$STORAGE_DIR/anythingllm.db"
{ cd /app/server/ &&\ { cd /app/server/ &&\
npx prisma generate --schema=./prisma/schema.prisma &&\ npx prisma generate --schema=./prisma/schema.prisma &&\

View File

@ -12,7 +12,7 @@ generator client {
// } // }
datasource db { datasource db {
provider = "sqlite" provider = "sqlite"
url = "file:../storage/anythingllm.db" url = "file:/storage/anythingllm.db"
} }
model api_keys { model api_keys {

View File

@ -7,10 +7,7 @@ function setupMulter() {
// Handle File uploads for auto-uploading. // Handle File uploads for auto-uploading.
const storage = multer.diskStorage({ const storage = multer.diskStorage({
destination: function (_, __, cb) { destination: function (_, __, cb) {
const uploadOutput = const uploadOutput = path.resolve(__dirname, `../../../collector/hotdir`);
process.env.NODE_ENV === "development"
? path.resolve(__dirname, `../../../collector/hotdir`)
: path.resolve(process.env.STORAGE_DIR, `../../collector/hotdir`);
cb(null, uploadOutput); cb(null, uploadOutput);
}, },
filename: function (_, file, cb) { filename: function (_, file, cb) {