perry2of5 commented on issue #10505:
URL: https://github.com/apache/apisix/issues/10505#issuecomment-3312709298
As mentioned above, I'm expanding the variables before starting apisix. I
added "tini" to ensure signals make it to APISIX and then I have startup script
"/usr/local/bin/startup.bash"
```bash
#!/bin/bash
pushd ${APISIX_CONF_DIR}
env | grep '^KNOWN_PREFIX_' | grep _SVC | while IFS='=' read -r name value ;
do
echo expanding $name
# using sed to replace variable in format ${{VAR_NAME}} in apisix.yaml in
this directory
sed -i "s|\${{$name}}|$value|g" apisix.yaml
done
popd
/docker-entrypoint.sh "$@" &
APISIX_PID=$!
echo "Started APISIX with PID $APISIX_PID"
trap "kill $APISIX_PID; exit" SIGTERM SIGINT
wait $NPM_PID
wait $APISIX_PID
```
Then in my Dockerfile:
```docker
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/startup.bash"]
CMD ["docker-start"]
STOPSIGNAL SIGQUIT
```
Feedback on ways to improve are welcome :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]