Do exactly as @shoob described, pay attention to the apps’ release tag and compatibility with other elements when building a custom image.
I might be wrong, we should consult with experts, but it might be beneficial to change environment settings to CREATE_SITE=0 and CONFIGURE=0 after the initial deployment for future updates and redeployment if you want to preserve data.