Files
kestra/docker-compose.yml
Loïc Mathieu 5860ce73bb feat(system): configure Docker Compose termination grace period to 6m
By default, Kestra has a termination grace period of 5m.
To be sure all tasks are terminated, we need to configure Docker Compose with a termination grace period of more than that: 6m.

Part-of: https://github.com/kestra-io/kestra-ee/issues/5556
2025-11-25 17:07:01 +01:00

66 lines
1.9 KiB
YAML

volumes:
postgres-data:
driver: local
kestra-data:
driver: local
services:
postgres:
image: postgres:18
volumes:
- postgres-data:/var/lib/postgresql
environment:
POSTGRES_DB: kestra
POSTGRES_USER: kestra
POSTGRES_PASSWORD: k3str4
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 30s
timeout: 10s
retries: 10
kestra:
image: kestra/kestra:latest
pull_policy: always
# Kestra, by default, has a termination grace period of 5m. We need to wait a little more to be sure no active tasks are running.
stop_grace_period: 6m
# Note that this setup with a root user is intended for development purpose.
# Our base image runs without root, but the Docker Compose implementation needs root to access the Docker socket
user: "root"
command: server standalone
volumes:
- kestra-data:/app/storage
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/kestra-wd:/tmp/kestra-wd
environment:
KESTRA_CONFIGURATION: |
datasources:
postgres:
url: jdbc:postgresql://postgres:5432/kestra
driverClassName: org.postgresql.Driver
username: kestra
password: k3str4
kestra:
# server:
# basic-auth:
# username: admin@kestra.io # it must be a valid email address
# password: Admin1234 # it must be at least 8 characters long with uppercase letter and a number
repository:
type: postgres
storage:
type: local
local:
base-path: "/app/storage"
queue:
type: postgres
tasks:
tmp-dir:
path: /tmp/kestra-wd/tmp
url: http://localhost:8080/
ports:
- "8080:8080"
- "8081:8081"
depends_on:
postgres:
condition: service_started