Replies: 1 comment
-
|
the problem is that docker containers are ephemeral by default. when you delete and recreate container, all data inside is lost. you need to use docker volumes to persist data. langflow stores data in sqlite by default. here is how to set it up: # docker-compose.yml
services:
langflow:
image: langflowai/langflow:latest
ports:
- "7860:7860"
volumes:
- langflow_data:/app/langflow
environment:
- LANGFLOW_DATABASE_URL=sqlite:////app/langflow/langflow.db
- LANGFLOW_CONFIG_DIR=/app/langflow
volumes:
langflow_data:the key points:
if you prefer to use host directory instead of docker volume: volumes:
- ./langflow_data:/app/langflowthis mounts local folder, easier to backup. for production, consider using postgres instead of sqlite: environment:
- LANGFLOW_DATABASE_URL=postgresql://user:pass@db:5432/langflow
services:
db:
image: postgres:15
volumes:
- postgres_data:/var/lib/postgresql/dataafter setting up volumes, your users, flows, and logs will persist across container restarts and recreations. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
May I ask a question: I am running on a Docker container and have configured user login authentication? However, why is it that after deleting and restarting my container, all the previously created users and process data are gone? How should I persist the data? Including users, logs, project data created by users, etc
Beta Was this translation helpful? Give feedback.
All reactions