🔧 chore(.env.example): add POSTGRES_PORT variable to specify the port for PostgreSQL connection
🔧 chore(startup-backend.sh): modify startup script to start the backend in development or production mode based on the ENVIRONMENT variable
This commit is contained in:
parent
6e52990322
commit
e557c0d234
2 changed files with 14 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
DOMAIN=localhost
|
||||
STACK_NAME=langflow-stack
|
||||
ENVIRONMENT=development
|
||||
|
||||
TRAEFIK_PUBLIC_NETWORK=traefik-public
|
||||
TRAEFIK_TAG=langflow-traefik
|
||||
|
|
@ -19,6 +20,7 @@ LOG_LEVEL=debug
|
|||
POSTGRES_USER=langflow
|
||||
POSTGRES_PASSWORD=langflow
|
||||
POSTGRES_DB=langflow
|
||||
POSTGRES_PORT=5432
|
||||
|
||||
# Flower configuration
|
||||
LANGFLOW_CACHE_TYPE=redis
|
||||
|
|
|
|||
|
|
@ -2,5 +2,16 @@
|
|||
|
||||
export LANGFLOW_DATABASE_URL="postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}"
|
||||
|
||||
|
||||
# Your command to start the backend
|
||||
exec python -m uvicorn --factory langflow.main:create_app --host 0.0.0.0 --port 7860 --log-level ${LOG_LEVEL:-info} --workers -1
|
||||
|
||||
# If the ENVIRONMENT variable is set to "development", then start the backend in development mode
|
||||
# else start the backend in production mode with guvicorn
|
||||
if [ "$ENVIRONMENT" = "development" ]; then
|
||||
echo "Starting backend in development mode"
|
||||
exec python -m uvicorn --factory langflow.main:create_app --host 0.0.0.0 --port 7860 --log-level ${LOG_LEVEL:-info} --workers 2 --reload
|
||||
else
|
||||
echo "Starting backend in production mode"
|
||||
exec langflow run --host 0.0.0.0 --port 7860 --log-level ${LOG_LEVEL:-info} --workers -1 --backend-only
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue