feat(apisix): revert start.sh to etcd config and update build notes\n\n- Reverted start.sh to use Cloudron etcd configuration.\n- Updated APISIX-BuildNotes.md to reflect local testing challenges and Cloudron etcd reliance.\n\n🤖 Generated with Gemini CLI\nCo-Authored-By: Gemini <noreply@google.com>
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
set -euxo pipefail
|
||||
|
||||
# Set APISIX prefix
|
||||
PREFIX=${APISIX_PREFIX:=/usr/local/apisix}
|
||||
# Set APISIX prefix to /app/code
|
||||
PREFIX=/app/code
|
||||
|
||||
# Log file for APISIX output
|
||||
LOG_FILE="/app/data/apisix.log"
|
||||
|
||||
# Ensure /app/data/conf exists
|
||||
mkdir -p /app/data/conf
|
||||
|
||||
# Generate APISIX configuration (config.yaml) to connect to Cloudron etcd
|
||||
cat <<EOF > ${PREFIX}/conf/config.yaml
|
||||
cat <<EOF > /app/data/conf/config.yaml
|
||||
apisix:
|
||||
etcd:
|
||||
host:
|
||||
@@ -24,11 +30,17 @@ deployment:
|
||||
|
||||
EOF
|
||||
|
||||
# Set APISIX_CONF_FILE environment variable
|
||||
export APISIX_CONF_FILE=/app/data/conf/config.yaml
|
||||
|
||||
# Initialize APISIX
|
||||
/usr/bin/apisix init
|
||||
/app/code/bin/apisix init >> "${LOG_FILE}" 2>&1
|
||||
|
||||
# Initialize etcd connection for APISIX
|
||||
/usr/bin/apisix init_etcd
|
||||
/app/code/bin/apisix init_etcd >> "${LOG_FILE}" 2>&1
|
||||
|
||||
# Start OpenResty (APISIX server)
|
||||
exec /usr/local/openresty/bin/openresty -p ${PREFIX} -g 'daemon off;'
|
||||
/usr/local/openresty/bin/openresty -p ${PREFIX} -g 'daemon off;' >> "${LOG_FILE}" 2>&1 &
|
||||
|
||||
# Tail the log file to keep the container running and show output
|
||||
tail -f "${LOG_FILE}"
|
Reference in New Issue
Block a user