Files
plane/apps/api/bin/docker-entrypoint-api.sh
T
61d64a6f84 [WEB-6113] fix: optimize api server startup (#5693)
* fix: optimize api server startup

* fix: update startup command to handle multiple editions

* fix: move collectstatic command to entrypoint script for improved Docker setup

* fix: collect static to startup script

---------

Co-authored-by: Pratapa Lakshmi <[email protected]>
2026-02-03 19:24:17 +05:30

21 lines
720 B
Bash
Executable File

#!/bin/bash
set -e
# Collect system information
HOSTNAME=$(hostname)
MAC_ADDRESS=$(ip link show | awk '/ether/ {print $2}' | head -n 1)
CPU_INFO=$(cat /proc/cpuinfo)
MEMORY_INFO=$(free -h)
DISK_INFO=$(df -h)
# Concatenate information and compute SHA-256 hash
SIGNATURE=$(echo "$HOSTNAME$MAC_ADDRESS$CPU_INFO$MEMORY_INFO$DISK_INFO" | sha256sum | awk '{print $1}')
# Export the variables
export MACHINE_SIGNATURE=$SIGNATURE
# Run consolidated startup
python manage.py startup community --machine-signature "$MACHINE_SIGNATURE"
exec gunicorn -w "$GUNICORN_WORKERS" -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:"${PORT:-8000}" --max-requests 1200 --max-requests-jitter 1000 --access-logfile -