A good post regarding this method can be found here.
When building seed data into a custom docker image, you must ensure that the image is securely stored, and only pushed to private docker registries.
You will then want to specify your custom image in the postgresql chart-values file, and ensure that docker credentials are provided in order for the cluster to pull the private image.
If you are using a self-managed cluster, you can also choose to handle registry authentication at the cluster level.
Helm Chart Install Hook
If you are using an application which supports application level data seeding (such as Rails), you can add a Helm post-install hook to execute your migration, and populate your data. Preview ensures that dependencies are ready and available before the deployment of application charts in order to support this use case. Note that for larger data sets, this will likely be slower than using a pre-built database image.
If you want to limit a Helm hook to only run within Preview, you can render the hook conditionally, and provide a key to your chart in a values file.
For more complicated data seeding, or if you have more complex configuration which must be applied after environment creation, Preview can deliver a webhook after workflow completion. This hook can be used to connect in to the deployed environment, and execute additional set up, such as injecting seed data into the Preview created database services.