It seems, timeout sends signals that do not stop the server process. Set the signal to SIGKILL - which also kills the function.sh process. Thus moved the last function to entrypoint.sh
Add function for replacing values in the beginning of a string. Add build secret.