We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15637b3 commit d64de12Copy full SHA for d64de12
deploy_prod.sh
@@ -0,0 +1,31 @@
1
+#!/usr/bin/env bash
2
+
3
+PID_FILE="/home/pk/pk.pid"
4
+LOG_DIR="/home/pk/logs"
5
6
+cd ~/
7
+cd python.or.kr
8
+# shutdown exist gunicorn
9
+if [ -f ${PID_FILE} ]; then
10
+ PID=$(cat $PID_FILE)
11
+ kill -TERM $PID
12
+ rm ${PID_FILE}
13
+fi
14
15
+mkdir -p ${LOG_DIR}
16
17
+# update changes before update
18
+# git pull
19
+source .venv/bin/activate
20
+uv sync
21
+cd pythonkr_backend
22
+export DJANGO_SETTINGS_MODULE="pythonkr_backend.settings.prod"
23
+./manage.py migrate --no-input
24
+./manage.py collectstatic --clear --noinput
25
+gunicorn --workers=2 \
26
+ -b :2026 \
27
+ --access-logfile ${LOG_DIR}/access.log \
28
+ --error-logfile ${LOG_DIR}/error.log \
29
+ --daemon \
30
+ --pid ${PID_FILE} \
31
+ pythonkr_backend.wsgi
0 commit comments