Docker entrypoint on instance vs Lifecycle job on Start

Hello,
I have a small question.
For preview environments, I seed my database inside a entrypoint-preview.sh script.
I was looking into the Lifecycle jobs and I was asking myself the difference between the two choices.
Is there a difference ? I will be using the same Docker image.
Maybe the Lifecycle is more efficient and the application container is built faster.

Hi @Thibault_Chatelain ,

supposing that your application runs with just 1 instance, that your entrypoint script manages the app restarts properly, the health checks of the app take into account a longer startup time due to the seeding step → the result is practically the same.
For small datasets, it’s probably better to manage it directly in the application since it will speed up the deployment time: If you add a lifecycle job, you have to create another stage in between the db and app deployment, increasing the deployment time by a few seconds (the time that the lifecycle job deployment is triggered)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.