Skip to content

Instantly share code, notes, and snippets.

@LeCoupa
Last active March 18, 2026 09:25
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)
name: temporal
services:
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:
- postgres:/var/lib/postgresql/data
healthcheck:
test: [CMD-SHELL, 'pg_isready -U ${POSTGRES_USER} -d temporal']
interval: 10s
timeout: 5s
retries: 10
start_period: 20s
schema:
image: temporalio/admin-tools:1.29
restart: no
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 ---'
"
environment:
SQL_HOST: postgres
SQL_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
SQL_PLUGIN: postgres12
SQL_PORT: 5432
SQL_USER: ${POSTGRES_USER:?POSTGRES_USER is required}
depends_on:
postgres:
condition: service_healthy
server:
image: temporalio/server:1.29.3
restart: unless-stopped
environment:
DB: postgres12
DB_PORT: 5432
POSTGRES_PWD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
POSTGRES_SEEDS: postgres
POSTGRES_USER: ${POSTGRES_USER:?POSTGRES_USER is required}
depends_on:
schema:
condition: service_completed_successfully
ports:
- '${TAILSCALE_IP:?TAILSCALE_IP is required}:7233:7233'
ui:
image: temporalio/ui:2.45.3
restart: unless-stopped
environment:
TEMPORAL_ADDRESS: 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'
depends_on:
- server
volumes:
postgres:
name: temporal-postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment