Prestart / sidecar = false -> Marked as dead | How to mark One-shot container as OK

Hello,

I have a task, which creates files and than stopping:

         task "django-collectstatic" {
            lifecycle {
               hook = "prestart"
                  sidecar = false
            }

            driver = "docker"
               template {
                  data = <<EOH
                  {{key "nomad/backoffice/environment"}}
                  EOH
                     destination = "local/env"
                     env         = true
               }
...
            config {
               image = "test:latest"
                  entrypoint = [ "./docker-entrypoint.sh", "collectstatic" ]
          }
...

So, its OK, that the container is then down (with exit 0), after the job was done. At the moment, it looks:

Jan 18, '23 15:55:03 +0100 Terminated Exit Code: 0

My issue is that Levant marks the Gitlab pipeline as failed:

2023-01-18T14:55:03Z |INFO| levant/job_status_checker: task django-collectstatic in allocation dcfac9d2-9a14-f493-bd02-34af173724e3 now in dead state job_id=backoffice_gunicorn
2023-01-18T14:55:04Z |INFO| levant/job_status_checker: task django in allocation dcfac9d2-9a14-f493-bd02-34af173724e3 now in running state job_id=backoffice_gunicorn
2023-01-18T14:55:04Z |INFO| levant/job_status_checker: task nginx in allocation dcfac9d2-9a14-f493-bd02-34af173724e3 now in running state job_id=backoffice_gunicorn
2023-01-18T14:55:04Z |ERRO| levant/deploy: job deployment failed job_id=backoffice_gunicorn
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit code 1

Is there a way to solve it ?

cu denny