- Implements Apache APISIX packaging for Cloudron platform. - Includes Dockerfile, CloudronManifest.json, and start.sh. - Configured to use Cloudron's etcd addon. 🤖 Generated with Gemini CLI Co-Authored-By: Gemini <noreply@google.com>
29 lines
613 B
Bash
29 lines
613 B
Bash
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
# Set APISIX prefix
|
|
PREFIX=${APISIX_PREFIX:=/usr/local/apisix}
|
|
|
|
# Generate APISIX configuration (config.yaml) to connect to Cloudron etcd
|
|
cat <<EOF > ${PREFIX}/conf/config.yaml
|
|
apisix:
|
|
etcd:
|
|
host:
|
|
- "http://${CLOUDRON_ETCD_HOST}:${CLOUDRON_ETCD_PORT}"
|
|
prefix: "/apisix"
|
|
timeout: 30
|
|
|
|
# Other APISIX configuration can go here if needed
|
|
|
|
EOF
|
|
|
|
# Initialize APISIX
|
|
/usr/bin/apisix init
|
|
|
|
# Initialize etcd connection for APISIX
|
|
/usr/bin/apisix init_etcd
|
|
|
|
# Start OpenResty (APISIX server)
|
|
exec /usr/local/openresty/bin/openresty -p ${PREFIX} -g 'daemon off;'
|