Skip to content

Commit

Permalink
feat: add start_local.sh of difylocal
Browse files Browse the repository at this point in the history
  • Loading branch information
WGrape committed Apr 8, 2024
1 parent e447669 commit 2d4f176
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions difylocal/templates/start_local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh

# enter difylocal docker
docker exec -it sparrow_container_test_difylocal /bin/sh

# start api ==============================

# 1. enter directory
cd /var/data/difylocal/dify/api
# 2. copy a env file
cp .env.example .env
# 3. make SECRET_KEY
openssl rand -base64 42
sed -i 's/SECRET_KEY=.*/SECRET_KEY=<your_value>/' .env
# 4. pip install
pip install -r requirements.txt
# 5. database migration
flask db upgrade

# daemon: start server
flask run --host 0.0.0.0 --port=5001 --debug
# daemon: start worker
celery -A app.celery worker -P gevent -c 1 -Q dataset,generation,mail --loglevel INFO

# start web ==============================
cd /var/data/difylocal/dify/web

# 1. enter directory
cd /var/data/difylocal/dify/web
# 2. npm install
npm install
# 3. copy a env file
cp .env.example .env.local
# 4. build your project
npm run build

# daemon: start server
npm run start

0 comments on commit 2d4f176

Please sign in to comment.