add kestra

This commit is contained in:
Hubert Cornet 2024-07-28 11:00:41 +02:00
parent a7f7ab5e85
commit b2ecf434aa
4 changed files with 173 additions and 0 deletions

View File

@ -34,6 +34,11 @@ services:
image: postgres:15.6-alpine
networks:
- back_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 30s
timeout: 10s
retries: 10
restart: always
volumes:
- ./init:/docker-entrypoint-initdb.d:ro

View File

@ -0,0 +1,5 @@
# Kestra avec docker-compose
## Buy me a coffe
<a href='https://ko-fi.com/R5R2KNI3N' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://storage.ko-fi.com/cdn/kofi4.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>

View File

@ -0,0 +1,93 @@
#### NETWORKS
networks:
docker-traefik_front_network:
external: true
back_network:
driver: bridge
attachable: true
#### SERVICES
services:
# postgres
postgres:
container_name: kestra-postgres
hostname: kestra-postgres
environment:
PGDATA: /var/lib/postgresql/data/kestra
POSTGRES_DB: kestra_db
POSTGRES_PASSWORD: 'P@ssword!Here!123456'
POSTGRES_USER: kestra_user
TZ: Europe/Paris
image: postgres:15.6-alpine
networks:
- back_network
volumes:
- ./data:/var/lib/postgresql/data:rw
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 30s
timeout: 10s
retries: 10
restart: always
# kestra
kestra:
container_name: kestra-app
hostname: kestra-app
environment:
KESTRA_CONFIGURATION: |
datasources:
postgres:
url: jdbc:postgresql://postgres:5432/kestra_db
driverClassName: org.postgresql.Driver
username: kestra_user
password: P@ssword!Here!123456
kestra:
server:
basic-auth:
enabled: false
username: "admin@kestra.io" # it must be a valid email address
password: kestra
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/
image: kestra/kestra:latest-full
pull_policy: always
# Note that this setup with a root user is intended for development purpose. For production deployments, you might prefer a version without a root user.
# Our base image runs without root, but the Docker Compose implementation needs root to access the Docker socket
# This version is rootless but more complex https://github.com/kestra-io/kestra/blob/develop/docker-compose-dind.yml
user: "root"
command: server standalone --worker-thread=128
volumes:
- ./kestra-data:/app/storage:rw
- /var/run/docker.sock:/var/run/docker.sock
- ./kestra-wd:/tmp/kestra-wd:rw
depends_on:
postgres:
condition: service_started
networks:
- back_network
- docker-traefik_front_network
restart: always
labels:
- "traefik.enable=true"
- "traefik.docker.network=docker-traefik_front_network"
# HTTP
- "traefik.http.routers.kestra-http.rule=Host(`kestra.tips-of-mine.local`)"
- "traefik.http.routers.kestra-http.entrypoints=http"
# HTTPS
- "traefik.http.routers.kestra-https.rule=Host(`kestra.tips-of-mine.local`)"
- "traefik.http.routers.kestra-https.entrypoints=https"
- "traefik.http.routers.kestra-https.tls=true"
- "traefik.http.routers.kestra.service=kestra-service"
# Middleware
# Service
- "traefik.http.services.kestra-service.loadbalancer.server.port=8081"

View File

@ -0,0 +1,70 @@
#### SERVICES
services:
# postgres
postgres:
container_name: kestra-postgres
hostname: kestra-postgres
environment:
PGDATA: /var/lib/postgresql/data/kestra
POSTGRES_DB: kestra_db
POSTGRES_PASSWORD: 'P@ssword!Here!123456'
POSTGRES_USER: kestra_user
TZ: Europe/Paris
image: postgres:15.6-alpine
volumes:
- ./data:/var/lib/postgresql/data:rw
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 30s
timeout: 10s
retries: 10
restart: always
# kestra
kestra:
container_name: kestra-app
hostname: kestra-app
environment:
KESTRA_CONFIGURATION: |
datasources:
postgres:
url: jdbc:postgresql://postgres:5432/kestra_db
driverClassName: org.postgresql.Driver
username: kestra_user
password: P@ssword!Here!123456
kestra:
server:
basic-auth:
enabled: false
username: "admin@kestra.io" # it must be a valid email address
password: kestra
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/
image: kestra/kestra:latest-full
pull_policy: always
# Note that this setup with a root user is intended for development purpose. For production deployments, you might prefer a version without a root user.
# Our base image runs without root, but the Docker Compose implementation needs root to access the Docker socket
# This version is rootless but more complex https://github.com/kestra-io/kestra/blob/develop/docker-compose-dind.yml
user: "root"
command: server standalone --worker-thread=128
volumes:
- ./kestra-data:/app/storage:rw
- /var/run/docker.sock:/var/run/docker.sock
- ./kestra-wd:/tmp/kestra-wd:rw
ports:
- "8088:8080"
- "8089:8081"
depends_on:
postgres:
condition: service_started
restart: always