Build [v.1.3.9]
This commit is contained in:
28
backend/entrypoint.sh
Executable file
28
backend/entrypoint.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
# =============================================================================
|
||||
# backend/entrypoint.sh
|
||||
# =============================================================================
|
||||
# Docker container entrypoint for TFM aInventory backend.
|
||||
# Runs first-run initialization then starts the application server.
|
||||
#
|
||||
# This script is the ENTRYPOINT defined in backend/Dockerfile.
|
||||
# DATA_DIR and LOGS_DIR are set via docker-compose.yml environment section.
|
||||
# =============================================================================
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "🐳 [Docker] Backend container starting..."
|
||||
echo "🐳 [Docker] DATA_DIR=${DATA_DIR:-/app/data}"
|
||||
echo "🐳 [Docker] LOGS_DIR=${LOGS_DIR:-/app/logs}"
|
||||
|
||||
# Export defaults if not already set by docker-compose
|
||||
export DATA_DIR="${DATA_DIR:-/app/data}"
|
||||
export LOGS_DIR="${LOGS_DIR:-/app/logs}"
|
||||
|
||||
# Run shared first-run initialization
|
||||
echo "🐳 [Docker] Running data initialization..."
|
||||
bash /app/scripts/init_data.sh
|
||||
|
||||
# Hand off to the application server
|
||||
echo "🐳 [Docker] Starting uvicorn..."
|
||||
exec python -m uvicorn backend.main:app --host 0.0.0.0 --port 8000
|
||||
Reference in New Issue
Block a user