Skip to content

Instantly share code, notes, and snippets.

@LeCoupa
Last active March 9, 2026 13:44
Show Gist options
  • Select an option

  • Save LeCoupa/5d300965cdd941e78e0788af38489e4a to your computer and use it in GitHub Desktop.

Select an option

Save LeCoupa/5d300965cdd941e78e0788af38489e4a to your computer and use it in GitHub Desktop.
Temporal Docker Compose (Updated 2026)
services:
temporal-postgres:
image: postgres:16
restart: unless-stopped
environment:
POSTGRES_DB: temporal
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
POSTGRES_USER: ${POSTGRES_USER:?POSTGRES_USER is required}
ports:
- "${TAILSCALE_IP:?TAILSCALE_IP is required}:4110:5432"
volumes:
- temporal-postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d temporal"]
interval: 10s
timeout: 5s
retries: 10
start_period: 20s
temporal-schema-setup:
image: temporalio/admin-tools:1.29
restart: "no"
depends_on:
temporal-postgres:
condition: service_healthy
environment:
SQL_HOST: temporal-postgres
SQL_USER: ${POSTGRES_USER:?POSTGRES_USER is required}
SQL_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
SQL_PLUGIN: postgres12
SQL_PORT: 5432
entrypoint: >
bash -euo pipefail -c "
echo '--- Creating temporal databases ---' &&
SQL_DATABASE=temporal temporal-sql-tool create-database || true &&
SQL_DATABASE=temporal_visibility temporal-sql-tool create-database || true &&
echo '--- Setting up temporal schema ---' &&
SQL_DATABASE=temporal temporal-sql-tool setup-schema -v 0.0 &&
SQL_DATABASE=temporal temporal-sql-tool update-schema -schema-dir /etc/temporal/schema/postgresql/v12/temporal/versioned &&
echo '--- Setting up visibility schema ---' &&
SQL_DATABASE=temporal_visibility temporal-sql-tool setup-schema -v 0.0 &&
SQL_DATABASE=temporal_visibility temporal-sql-tool update-schema -schema-dir /etc/temporal/schema/postgresql/v12/visibility/versioned &&
echo '--- Schema setup complete ---'
"
temporal-server:
image: temporalio/server:1.29.3
restart: unless-stopped
depends_on:
temporal-schema-setup:
condition: service_completed_successfully
environment:
DB: postgres12
DB_PORT: 5432
POSTGRES_USER: ${POSTGRES_USER:?POSTGRES_USER is required}
POSTGRES_PWD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
POSTGRES_SEEDS: temporal-postgres
ports:
- "${TAILSCALE_IP:?TAILSCALE_IP is required}:7233:7233"
temporal-ui:
image: temporalio/ui:2.45.3
restart: unless-stopped
depends_on:
- temporal-server
environment:
TEMPORAL_ADDRESS: temporal-server:7233
TEMPORAL_CORS_ORIGINS: https://${TEMPORAL_UI_DOMAIN:?TEMPORAL_UI_DOMAIN is required}
TEMPORAL_NAMESPACE: ${TEMPORAL_DEFAULT_NAMESPACE:-default}
TEMPORAL_PERMIT_WRITE_API: "true"
volumes:
temporal-postgres-data:
name: temporal-postgres-data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment