# Temporal on one exe.dev VM: https://exe.dev/deploy/temporal # PostgreSQL, the Temporal server and the Web UI. Every port is published on # 127.0.0.1 only: exe.dev's HTTPS proxy reaches the UI and the HTTP API there, # and workers on this VM reach the gRPC frontend at localhost:7233. name: temporal services: postgresql: image: postgres:16 restart: unless-stopped environment: POSTGRES_USER: temporal POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set it in .env} volumes: - ./postgres:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U temporal"] interval: 5s timeout: 5s retries: 60 # Creates the two databases and brings their schemas up to this server # version, then exits. Safe to run again: that's how upgrades get their # schema changes. schema: image: temporalio/admin-tools:${TEMPORAL_VERSION:?} depends_on: postgresql: condition: service_healthy environment: SQL_PLUGIN: postgres12 SQL_HOST: postgresql SQL_PORT: "5432" SQL_USER: temporal SQL_PASSWORD: ${POSTGRES_PASSWORD} entrypoint: ["/bin/sh", "-euc"] command: - | for db in temporal temporal_visibility; do dir=temporal; [ $$db = temporal_visibility ] && dir=visibility temporal-sql-tool --db $$db create 2>/dev/null || true temporal-sql-tool --db $$db setup-schema -v 0.0 2>/dev/null || true temporal-sql-tool --db $$db update-schema -d /etc/temporal/schema/postgresql/v12/$$dir/versioned done temporal: image: temporalio/server:${TEMPORAL_VERSION:?} restart: unless-stopped depends_on: schema: condition: service_completed_successfully environment: DB: postgres12 DB_PORT: "5432" POSTGRES_SEEDS: postgresql POSTGRES_USER: temporal POSTGRES_PWD: ${POSTGRES_PASSWORD} BIND_ON_IP: 0.0.0.0 DYNAMIC_CONFIG_FILE_PATH: /etc/temporal/config/dynamicconfig/dynamic.yaml volumes: - ./dynamicconfig:/etc/temporal/config/dynamicconfig:ro ports: - "127.0.0.1:7233:7233" # gRPC: SDKs, workers, the CLI - "127.0.0.1:7243:7243" # HTTP API healthcheck: test: ["CMD", "nc", "-z", "localhost", "7233"] interval: 5s timeout: 3s retries: 60 ui: image: temporalio/ui:${TEMPORAL_UI_VERSION:?} restart: unless-stopped depends_on: temporal: condition: service_healthy environment: TEMPORAL_ADDRESS: temporal:7233 ports: - "127.0.0.1:8000:8080"