From 708b3019bf8bfdbbc99ab35fd0fd0c8d1b66523c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1z=20Berke=20G=C3=BCven=C3=A7?= Date: Wed, 8 Jul 2026 00:44:42 +0300 Subject: [PATCH] feat(postiz): update docker-compose and template for Temporal integration (#851) --- blueprints/postiz/docker-compose.yml | 80 ++++++++++++++++++++++++++-- blueprints/postiz/template.toml | 26 ++++++--- 2 files changed, 93 insertions(+), 13 deletions(-) diff --git a/blueprints/postiz/docker-compose.yml b/blueprints/postiz/docker-compose.yml index dfbf3ae9..a00832dd 100644 --- a/blueprints/postiz/docker-compose.yml +++ b/blueprints/postiz/docker-compose.yml @@ -13,10 +13,25 @@ services: DATABASE_URL: "postgresql://${DB_USER}:${DB_PASSWORD}@postiz-postgres:5432/${DB_NAME}" REDIS_URL: "redis://postiz-redis:6379" BACKEND_INTERNAL_URL: "http://localhost:3000" + TEMPORAL_ADDRESS: "temporal:7233" IS_GENERAL: "true" + DISABLE_REGISTRATION: "false" + RUN_CRON: "true" + NOT_SECURED: "true" STORAGE_PROVIDER: "local" UPLOAD_DIRECTORY: "/uploads" NEXT_PUBLIC_UPLOAD_DIRECTORY: "/uploads" + + # === Social Media API Settings === + # These variables should be defined in the Dokploy Environment tab. + # For more configuration options and details, please refer to the official documentation. + FACEBOOK_APP_ID: ${FACEBOOK_APP_ID} + FACEBOOK_APP_SECRET: ${FACEBOOK_APP_SECRET} + LINKEDIN_CLIENT_ID: ${LINKEDIN_CLIENT_ID} + LINKEDIN_CLIENT_SECRET: ${LINKEDIN_CLIENT_SECRET} + X_API_KEY: ${X_API_KEY} + X_API_SECRET: ${X_API_SECRET} + volumes: - postiz-config:/config/ - postiz-uploads:/uploads/ @@ -25,6 +40,8 @@ services: condition: service_healthy postiz-redis: condition: service_healthy + temporal: + condition: service_started postiz-postgres: image: postgres:17-alpine @@ -35,27 +52,80 @@ services: POSTGRES_USER: ${DB_USER} POSTGRES_DB: ${DB_NAME} volumes: - - postiz-postgres-data:/var/lib/postgresql/data + - postgres-volume:/var/lib/postgresql/data healthcheck: - test: pg_isready -U ${DB_USER} -d ${DB_NAME} + test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"] interval: 10s timeout: 3s retries: 3 + start_period: 10s postiz-redis: image: redis:7.2 restart: always healthcheck: - test: redis-cli ping + test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 3s retries: 3 volumes: - postiz-redis-data:/data + temporal-elasticsearch: + image: elasticsearch:7.17.27 + environment: + - cluster.routing.allocation.disk.threshold_enabled=true + - cluster.routing.allocation.disk.watermark.low=512mb + - cluster.routing.allocation.disk.watermark.high=256mb + - cluster.routing.allocation.disk.watermark.flood_stage=128mb + - discovery.type=single-node + - ES_JAVA_OPTS=-Xms256m -Xmx256m + - xpack.security.enabled=false + volumes: + - temporal-es-data:/usr/share/elasticsearch/data + + temporal-postgresql: + image: postgres:16 + environment: + POSTGRES_PASSWORD: ${TEMPORAL_PASSWORD} + POSTGRES_USER: ${TEMPORAL_USER} + volumes: + - temporal-pg-data:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ${TEMPORAL_USER}"] + interval: 10s + timeout: 5s + retries: 5 + + temporal: + image: temporalio/auto-setup:1.28.1 + depends_on: + temporal-postgresql: + condition: service_healthy + temporal-elasticsearch: + condition: service_started + environment: + - DB=postgres12 + - DB_PORT=5432 + - POSTGRES_USER=${TEMPORAL_USER} + - POSTGRES_PWD=${TEMPORAL_PASSWORD} + - POSTGRES_SEEDS=temporal-postgresql + - ENABLE_ES=true + - ES_SEEDS=temporal-elasticsearch + - ES_VERSION=v7 + - TEMPORAL_NAMESPACE=default + healthcheck: + test: ["CMD", "tctl", "--address", "127.0.0.1:7233", "workflow", "list"] + interval: 15s + timeout: 10s + retries: 30 + start_period: 120s + volumes: - postiz-postgres-data: + postgres-volume: postiz-redis-data: postiz-config: - postiz-uploads: \ No newline at end of file + postiz-uploads: + temporal-es-data: + temporal-pg-data: \ No newline at end of file diff --git a/blueprints/postiz/template.toml b/blueprints/postiz/template.toml index 260b77af..4528e909 100644 --- a/blueprints/postiz/template.toml +++ b/blueprints/postiz/template.toml @@ -3,19 +3,29 @@ main_domain = "${domain}" db_password = "${password}" db_user = "postiz" db_name = "postiz" +temporal_password = "${password}" +temporal_user = "temporal" jwt_secret = "${base64:32}" [config] +env = [ + "POSTIZ_HOST=${main_domain}", + "JWT_SECRET=${jwt_secret}", + "DB_USER=${db_user}", + "DB_PASSWORD=${db_password}", + "DB_NAME=${db_name}", + "TEMPORAL_USER=${temporal_user}", + "TEMPORAL_PASSWORD=${temporal_password}", + "FACEBOOK_APP_ID=", + "FACEBOOK_APP_SECRET=", + "LINKEDIN_CLIENT_ID=", + "LINKEDIN_CLIENT_SECRET=", + "X_API_KEY=", + "X_API_SECRET=" +] mounts = [] [[config.domains]] serviceName = "postiz-app" -port = 5_000 +port = 5000 host = "${main_domain}" - -[config.env] -POSTIZ_HOST = "${main_domain}" -DB_PASSWORD = "${db_password}" -DB_USER = "${db_user}" -DB_NAME = "${db_name}" -JWT_SECRET = "${jwt_secret}"