-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathentrypoint_dev.sh
More file actions
executable file
·65 lines (43 loc) · 1.73 KB
/
entrypoint_dev.sh
File metadata and controls
executable file
·65 lines (43 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/sh
source ./docker/entrypoints/common.sh
log_current_user
log_version_info
log "Starting development environment..."
cd /repo/frontend
# pnpm run build:dev & # use this for debugging with ios, port 5001 (no cors allowed)
pnpm run dev & # normal dev, port 5173
cd /repo
mkdir -p /repo/log
rm /repo/log/for_web.log >/dev/null 2>&1
rm /repo/frontend/vite.config.ts.timestamp-*.mjs >/dev/null 2>&1
mkdir -p /config/beets
mkdir -p /config/beets-flask
export FLASK_ENV=development
export FLASK_DEBUG=1
# ------------------------------------------------------------------------------------ #
# start backend #
# ------------------------------------------------------------------------------------ #
# running the server from inside the backend dir makes imports and redis easier
cd /repo/backend
redis-server --daemonize yes
# blocking
python ./launch_db_init.py
python ./launch_redis_workers.py
# keeps running in the background
python ./launch_watchdog_worker.py &
redis-cli FLUSHALL
# generate types for the frontend (only done in dev mode)
python ./generate_types.py
# we need to run with one worker for socketio to work (but need at least threads for SSEs)
# sufficient timout for the interactive import sessions, which may take a couple of minutes
# gunicorn --worker-class eventlet -w 1 --threads 32 --timeout 300 --bind 0.0.0.0:5001 --reload 'main:create_app()'
# see for available cli options:
# https://www.uvicorn.org/#command-line-options
uvicorn beets_flask.server.app:create_app --port 5001 \
--host 0.0.0.0 \
--factory \
--workers 1 \
--use-colors \
--reload
# if we need to debug the continaer without running the webserver:
# tail -f /dev/null