This commit is contained in:
2024-04-02 21:58:31 +02:00
parent 7dc441b2fc
commit 562834d131
29 changed files with 746 additions and 0 deletions

View File

@ -0,0 +1,22 @@
datasources:
postgres:
url: jdbc:postgresql://postgres-demo-1:5432/kestra
driverClassName: org.postgresql.Driver
username: kestra
password: k3str4
kestra:
server:
basic-auth:
enabled: false
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/

View File

@ -0,0 +1,48 @@
networks:
frontend:
external: true
volumes:
kestra-data:
driver: local
postgres-data:
driver: local
services:
postgres:
image: postgres
container_name: postgres-demo-1
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 30s
timeout: 10s
retries: 10
restart: unless-stopped
kestra:
image: kestra/kestra:latest-full
container_name: kestra-demo-1
pull_policy: always
entrypoint: /bin/bash
user: "root"
command:
- -c
- /app/kestra server standalone --worker-thread=128 -c config.yaml
volumes:
- kestra-data:/app/storage
- ./config/config.yaml:/app/config.yaml:ro
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/kestra-wd:/tmp/kestra-wd
environment:
- KESTRA_DOCKERHUB_USERNAME=${KESTRA_DOCKERHUB_USERNAME}
- KESTRA_DOCKERHUB_PASSWORD=${KESTRA_DOCKERHUB_PASSWORD}
ports:
- 8280:8080
- 8281:8081
restart: unless-stopped
depends_on:
postgres:
condition: service_started

View File

@ -0,0 +1,21 @@
id: build-docker-1
namespace: demo
tasks:
- id: git
type: io.kestra.core.tasks.flows.WorkingDirectory
tasks:
- id: clone
type: io.kestra.plugin.git.Clone
url: https://github.com/christianlempa/hackbox
branch: main
- id: build
type: io.kestra.plugin.docker.Build
dockerfile: "src/Dockerfile"
tags:
- registry.hub.docker.com/xcad2k/hackbox-test:latest
push: true
credentials:
username: "{{ envs.dockerhub_username }}"
password: "{{ envs.dockerhub_password }}"

View File

@ -0,0 +1,30 @@
id: build-docker-2
namespace: demo
tasks:
- id: directory
type: io.kestra.core.tasks.flows.WorkingDirectory
tasks:
- id: createFiles
type: io.kestra.core.tasks.storages.LocalFiles
inputs:
Dockerfile: |
FROM alpine:latest
WORKDIR /app
COPY . /app
RUN apk add --update python3
CMD [ "python", "main.py"]
main.py: |
if __name__ == "__main__":
print("Hello from Docker!")
exit(0)
- id: build
type: io.kestra.plugin.docker.Build
dockerfile: "Dockerfile"
tags:
- registry.hub.docker.com/xcad2k/hello-docker:latest
push: true
credentials:
username: "{{ envs.dockerhub_username }}"
password: "{{ envs.dockerhub_password }}"