-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentry-point.sh
More file actions
executable file
·47 lines (37 loc) · 1.08 KB
/
Copy pathentry-point.sh
File metadata and controls
executable file
·47 lines (37 loc) · 1.08 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
#!/bin/bash
# ============================================
# Fly-Python 容器入口脚本
# 用法:
# entry-point.sh → 默认启动 bash
# entry-point.sh server → 启动 FastAPI 服务
# entry-point.sh worker → 启动 Celery Worker
# entry-point.sh beat → 启动 Celery Beat (定时调度)
# entry-point.sh all → 同时启动 Worker + Beat
# ============================================
set -e
cd /app
case "${1:-bash}" in
server)
echo "[entry] 启动 FastAPI 服务..."
exec python main.py
;;
worker)
echo "[entry] 启动 Celery Worker..."
exec celery -A celery_app worker --loglevel=info
;;
beat)
echo "[entry] 启动 Celery Beat..."
exec celery -A celery_app beat --loglevel=info
;;
all)
echo "[entry] 启动 Celery Worker + Beat..."
exec celery -A celery_app worker --beat --loglevel=info
;;
bash|sh)
exec /bin/bash
;;
*)
# 允许直接传任意命令
exec "$@"
;;
esac