Package or bust!
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user