-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdepoly.sh
More file actions
36 lines (30 loc) · 1014 Bytes
/
Copy pathdepoly.sh
File metadata and controls
36 lines (30 loc) · 1014 Bytes
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
#!/bin/bash
set -e
APP_NAME="gaonbooks-dev"
# 2. 기존 gunicorn 프로세스 종료 (이름 기준)
echo ">>> 기존 Gunicorn 종료..."
PIDS=$(ps aux | grep "gunicorn app.main:app" | grep "$APP_NAME" | awk '{print $2}')
if [ -n "$PIDS" ]; then
echo ">>> 프로세스 종료: $PIDS"
kill -TERM $PIDS
else
echo ">>> 종료할 프로세스 없음"
fi
# 3. 백엔드 실행
echo ">>> 백엔드(Gunicorn) 실행..."
#TODO: Lock 파일 삭제 및 pipenv clean 진행해야 함
/home/ingyu/anaconda3/bin/pipenv install
/home/ingyu/anaconda3/bin/pipenv run gunicorn app.main:app \
--name "$APP_NAME" \
-w 2 \
-k uvicorn.workers.UvicornWorker \
--bind 0.0.0.0:8000 \
--access-logfile ./gunicorn-access.log \
--error-logfile ./gunicorn-error.log \
--capture-output \
--log-level info \
--daemon
# 4. 프론트엔드 재시작 (pm2)
echo ">>> 프론트엔드(pm2) 재시작..."
/home/ingyu/.nvm/versions/node/v20.19.5/bin/pm2 restart frontend
echo ">>> 배포 완료!"