I would suggest setting an --uplink-key when launching the App Server, and having your startup script connect and run its initialisation via the Uplink.
You can find a reference for the uplink-key option, plus the URL to pass to anvil.server.connect(), in that section of the App Server docs 