feat(07-04): update backend/entrypoint.sh with config validation
This commit is contained in:
@@ -2,11 +2,9 @@
|
||||
# =============================================================================
|
||||
# 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.
|
||||
# [D-07] Backend entrypoint - loads config from /app/config/ (YAML format)
|
||||
# Config sources: /app/config/backend.yaml, /app/config/secrets.yaml, environment variables
|
||||
# [D-06] Environment variables override YAML config (takes precedence)
|
||||
# =============================================================================
|
||||
|
||||
set -euo pipefail
|
||||
@@ -19,11 +17,12 @@ echo "🐳 [Docker] LOGS_DIR=${LOGS_DIR:-/app/logs}"
|
||||
export DATA_DIR="${DATA_DIR:-/app/data}"
|
||||
export LOGS_DIR="${LOGS_DIR:-/app/logs}"
|
||||
|
||||
# [D-06] Configuration - Config is loaded from /app/config/ (YAML format)
|
||||
# System environment variables override YAML config (D-06 load order).
|
||||
# No inventory.env fallback is used by the backend application.
|
||||
# Verify config is accessible
|
||||
if [ ! -f "/app/config/backend.yaml" ]; then
|
||||
echo "⚠️ [Docker] WARNING: /app/config/backend.yaml not found! Using defaults."
|
||||
echo "❌ [Docker] ERROR: /app/config/backend.yaml not found!"
|
||||
echo "❌ [Docker] Config must be mounted from host at /app/config/ (read-only)"
|
||||
echo "❌ [Docker] See config/README.md for setup instructions"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run shared first-run initialization
|
||||
|
||||
Reference in New Issue
Block a user