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
# in other service docker builds
if test -f "$STORAGE_DIR/.env"; then
export $(xargs < "$STORAGE_DIR/.env")
echo $STORAGE_DIR
# Copy pre-built assets into storage dir.
cp -r /app/server/storage/assets/ "$STORAGE_DIR/assets"
fi
mkdir -p "$STORAGE_DIR/documents"
mkdir -p "$STORAGE_DIR/models"
mkdir -p "$STORAGE_DIR/vector-cache"
mkdir -p "$STORAGE_DIR/assets"
touch "$STORAGE_DIR/anythingllm.db"
{ cd /app/server/ &&\
npx prisma generate --schema=./prisma/schema.prisma &&\

View File

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

View File

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