Skip to content

Commit

Permalink
materialize the {APP_DATA_DIR}/storage location for Prisma's use
Browse files Browse the repository at this point in the history
Placing a file in the app's destination volume for the SQLite database
the app needs to create appears to force Tipi to materialize the folder
at a point in the process where AnythingLLM's Prisma client could access
it on first run.

Without this, the Prisma client tried to create the file at a
as-yet-nonexistant path and failed. Tipi subsequently created the volume
location (b/c it was there on the host after Prisma failed) and a simple
app restart allowed Prisma to run its migrations on the file it could
now create.

steps:

- attempt an init service
- try getting rid of the env var for the storage and stop depending on
the init service
- try an init service again; removing the env var did nothing
- materialize the file?
- remove the volume init service
- try nesting the storage volume inside data
- along with precreating the file? or maybe i won't need that?
- try without preseeding the file
- what if we materialize a different file?
- non-debugging `restart` flag
  • Loading branch information
cori-gallimaufries authored and cori committed Sep 3, 2024
1 parent df53493 commit 15d5cba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions apps/anything-llm/data/storage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This file forces Tipi to create the `storage` directory in `${APP_DATA_DIR}` so that it's there when AnythingLLM's Prisma client needs to create the SQLite database on first use.
5 changes: 2 additions & 3 deletions apps/anything-llm/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
version: "3.9"
services:
anything-llm:
container_name: anything-llm
image: ghcr.io/mintplex-labs/anything-llm:1.2.1
restart: always
restart: unless-stopped
environment:
- TZ=${TZ}
- STORAGE_DIR=/app/server/storage
Expand All @@ -12,7 +11,7 @@ services:
cap_add:
- SYS_ADMIN
volumes:
- ${APP_DATA_DIR}/storage:/app/server/storage
- ${APP_DATA_DIR}/data/storage:/app/server/storage
- ${APP_DATA_DIR}/app.env:/app/server/.env
networks:
- tipi_main_network
Expand Down

0 comments on commit 15d5cba

Please sign in to comment.