docker: add setup guide and fix .env.example defaults#6352
docker: add setup guide and fix .env.example defaults#6352wosolcode wants to merge 1 commit intoFlowiseAI:mainfrom
Conversation
- Add docker/SETUP.md with step-by-step local deployment guide covering
prerequisites, .env configuration, container startup, first-admin
account creation, data persistence, and a quick-start LLM flow guide.
- Update docker/.env.example with correct defaults for Docker Compose:
- Pre-fill all path variables to /root/.flowise (container-side of
the ~/.flowise:/root/.flowise volume mount) to prevent the
'ENOENT: mkdir empty-string' crash-loop on first start.
- Enable SECRETKEY_STORAGE_TYPE=local, STORAGE_TYPE=local,
LOG_LEVEL=info, DISABLE_FLOWISE_TELEMETRY=true, and
APP_URL=http://localhost:3000 as working defaults.
- Mark the four secret tokens (JWT_AUTH_TOKEN_SECRET,
JWT_REFRESH_TOKEN_SECRET, EXPRESS_SESSION_SECRET, TOKEN_HASH_SECRET)
with '<run: openssl rand -hex 32>' placeholders so operators know
they must be generated before starting.
Note: .env (with actual secrets) remains gitignored.
Co-Authored-By: Oz <oz-agent@warp.dev>
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive Docker setup guide and updates the .env.example file with default paths to prevent startup failures caused by empty environment variables. The review feedback highlights a security concern regarding the use of placeholder strings for secret keys, suggesting they remain empty to ensure users provide unique, secure values during setup.
| JWT_AUTH_TOKEN_SECRET=<run: openssl rand -hex 32> | ||
| JWT_REFRESH_TOKEN_SECRET=<run: openssl rand -hex 32> |
There was a problem hiding this comment.
Using <run: openssl rand -hex 32> as a default value for secrets is potentially risky. If a user copies the file without replacing these values, the application will run with these literal strings as secrets, which are publicly known. Since these are not path variables and won't trigger the mkdir crash described in the PR, it is safer to leave them empty. This forces the user to provide a secure value as intended by the setup guide.
JWT_AUTH_TOKEN_SECRET=
JWT_REFRESH_TOKEN_SECRET=
|
|
||
| # Generate a secure 32-byte secret using: openssl rand -hex 32 (or leave unset for file/AWS storage) | ||
| # EXPRESS_SESSION_SECRET= | ||
| EXPRESS_SESSION_SECRET=<run: openssl rand -hex 32> |
|
|
||
| # Generate a secure 32-byte secret using: openssl rand -hex 32 (or leave unset for file/AWS storage) | ||
| # TOKEN_HASH_SECRET= | ||
| TOKEN_HASH_SECRET=<run: openssl rand -hex 32> |
Summary
This PR fixes a startup crash-loop that affects anyone deploying Flowise locally with Docker Compose, and adds a setup guide to prevent future confusion.
Problem
When
docker compose upis run aftercp .env.example .envwithout filling in path variables, Docker passes empty strings forDATABASE_PATH,LOG_PATH,BLOB_STORAGE_PATH, andSECRETKEY_PATHinto the container. Flowise then crashes immediately with:The container enters a restart loop and never becomes healthy.
Changes
docker/.env.example/root/.flowise— the container-side path of the existing~/.flowise:/root/.flowisevolume mount. This is the correct default and prevents the crash.SECRETKEY_STORAGE_TYPE=localandSTORAGE_TYPE=localexplicitly (were commented out).LOG_LEVEL=info,DISABLE_FLOWISE_TELEMETRY=true, andAPP_URL=http://localhost:3000as working defaults.JWT_AUTH_TOKEN_SECRET,JWT_REFRESH_TOKEN_SECRET,EXPRESS_SESSION_SECRET,TOKEN_HASH_SECRET) with<run: openssl rand -hex 32>placeholders so operators know they must be generated before starting.docker/SETUP.md(new)Step-by-step local deployment guide covering:
.envconfiguration (which variables to set and why)~/.flowiseTesting
Verified on macOS with Docker Desktop:
cp .env.example .env+ fill in the four secrets →docker compose up -dstarts cleanlycurl http://localhost:3000/api/v1/ping→pongPOST /api/v1/account/registerGenerated with Warp
Co-Authored-By: Oz oz-agent@warp.dev