This repository was archived by the owner on Feb 15, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
48 lines (39 loc) · 1.71 KB
/
entrypoint.sh
File metadata and controls
48 lines (39 loc) · 1.71 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
#!/bin/bash
echo " ____ __ __ ___ __ "
echo " / __ \____ _____/ /_____ _/ /_ ____ _________ / | ____ ____ ____ / /_ "
echo " / /_/ / __ \/ ___/ __/ __ / __ \/ __ / ___/ _ \ / /| |/ __ / _ \/ __ \/ __/ "
echo " / ____/ /_/ / / / /_/ /_/ / /_/ / /_/ (__ ) __/ / ___ / /_/ / __/ / / / /_ "
echo " /_/ \____/_/ \__/\__,_/_.___/\__,_/____/\___/ /_/ |_\__, /\___/_/ /_/\__/ "
echo " /____/ "
PROJECT_VERSION=$(python3 -c "from importlib.metadata import version; print(version('portabase-agent'))")
echo "[INFO] Project version: $PROJECT_VERSION"
echo "/usr/lib/x86_64-linux-gnu" | tee /etc/ld.so.conf.d/libpq.conf &>/dev/null
ldconfig &>/dev/null
ldconfig -p | grep libpq &>/dev/null
ldd /usr/lib/postgresql/17/bin/pg_isready &>/dev/null || true
if [ -n "$TZ" ]; then
if [ -f "/usr/share/zoneinfo/$TZ" ]; then
ln -sf /usr/share/zoneinfo/$TZ /etc/localtime
echo "$TZ" > /etc/timezone
echo "[INFO] Timezone set to $TZ"
else
echo "[WARN] Timezone '$TZ' not found. Using default."
fi
fi
echo "Starting Redis server..."
redis-server --loglevel notice &>/dev/null &
if [ "$ENVIRONMENT" = "development" ]; then
echo "[INFO] Starting Celery worker with hot reload..."
watchmedo auto-restart \
--directory=./src \
--pattern="*.py" \
--recursive \
-- \
celery -A main worker --loglevel=info &
else
echo "[INFO] Starting Celery worker..."
celery -A main worker --loglevel=info &
fi
echo "Starting Celery Beat..."
celery -A main beat -S redbeat.RedBeatScheduler --loglevel=info &
wait