Package or bust!

This commit is contained in:
2025-10-17 15:09:03 -05:00
parent c8c4bd4e9b
commit 1fe434ea3e
20 changed files with 288 additions and 416 deletions

View File

@@ -9,15 +9,31 @@ abort() { echo "[start] ERROR: $*" >&2; exit 1; }
log "Starting Apache APISIX on port ${APP_PORT}"
# Ensure APISIX data directory exists
mkdir -p /app/data/apisix
# Example: ensure /app/data exists and is writable
mkdir -p /app/data
chown -R cloudron:cloudron /app/data || true
# Set APISIX environment
export APISIX_HOME=/app/data/apisix
export APISIX_WORKDIR=/app/data/apisix
# Example addon integration (uncomment and adapt as needed)
# if [[ -n "${CLOUDRON_POSTGRESQL_URL:-}" ]]; then
# log "Detected PostgreSQL addon"
# # Use $CLOUDRON_POSTGRESQL_* env vars
# fi
# Start APISIX using the official entrypoint
log "Starting APISIX API Gateway"
exec /docker-entrypoint.sh docker-start
# if [[ -n "${CLOUDRON_REDIS_URL:-}" ]]; then
# log "Detected Redis addon"
# fi
# If your app needs config generation, do it here
# cat > /app/data/config.yaml <<'YAML'
# key: value
# YAML
# Example: start a simple HTTP server (placeholder)
# Replace with your actual app start command
if command -v python3 >/dev/null 2>&1; then
log "Launching placeholder server: python3 -m http.server ${APP_PORT}"
exec python3 -m http.server "${APP_PORT}" --bind 0.0.0.0
else
abort "No application command configured. Replace placeholder with your app's start command."
fi