A containerized Temporal workflow orchestration setup with PostgreSQL database and web UI for building distributed applications.
This project provides a complete Temporal development environment using Docker Compose. Temporal is a durable execution platform that makes it easy to build and operate resilient applications at scale.
The setup consists of three main components:
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β PostgreSQL β β Temporal β β Temporal UI β
β Database ββββββ€ Server ββββββ€ Web Interface β
β Port: 5433 β β Port: 7234 β β Port: 8235 β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
-
PostgreSQL Database (
postgres:13)- Persistent storage for Temporal server state
- Container:
temporal-postgres-quiz - External Port:
5433β Internal Port:5432 - Database:
temporal - Credentials:
temporal/temporal
-
Temporal Server (
temporalio/auto-setup:1.23)- Core Temporal services (Frontend, History, Matching, Worker)
- Container:
temporal-quiz - API Port:
7234(Frontend API) - Automatically sets up database schema on first run
-
Temporal Web UI (
temporalio/ui:2.21.3)- Web interface for monitoring workflows and activities
- Container:
temporal-ui-quiz - External Port:
8235β Internal Port:8080 - Access URL: http://localhost:8235
- Docker and Docker Compose installed
- Ports 5433, 7234, and 8235 available on your system
# Clone or navigate to the project directory
cd Quiz-temporal
# Start all services in detached mode
docker-compose up -d
# Check service status
docker-compose ps
# View logs (optional)
docker-compose logs -f- Temporal Web UI: http://localhost:8235
- Temporal Server API:
localhost:7234 - PostgreSQL Database:
localhost:5433
# Stop all services
docker-compose down
# Stop and remove volumes (deletes all data)
docker-compose down -vQuiz-temporal/
βββ docker-compose.yml # Container orchestration configuration
βββ README.md # This documentation file
All ports have been configured to avoid conflicts with default installations:
| Service | External Port | Internal Port | Purpose |
|---|---|---|---|
| PostgreSQL | 5433 | 5432 | Database connections |
| Temporal API | 7234 | 7233 | Temporal client connections |
| Temporal UI | 8235 | 8080 | Web interface |
PostgreSQL:
POSTGRES_USER: temporal
POSTGRES_PASSWORD: temporal
POSTGRES_DB: temporalTemporal Server:
DB: postgres12
DB_PORT: 5432
POSTGRES_USER: temporal
POSTGRES_PWD: temporal
POSTGRES_SEEDS: postgresTemporal UI:
TEMPORAL_ADDRESS: temporal:7233
TEMPORAL_CORS_ORIGINS: http://localhost:8235To connect your application to this Temporal server:
// Example Node.js connection
const { Client } = require('@temporalio/client');
const client = new Client({
serviceUrl: 'localhost:7234',
namespace: 'default', // or your custom namespace
});# Example Python connection
from temporalio.client import Client
async def main():
client = await Client.connect("localhost:7234")Once connected, you can:
- Define workflows and activities in your preferred language
- Register workers that connect to
localhost:7234 - Start workflow executions
- Monitor them via the web UI at http://localhost:8235
-
Port Conflicts
- Don't change ports back to defaults (7233, 8233, 5432) if you have other services running
- Always check
docker-compose psbefore assuming services are healthy
-
Missing Dependencies
- Don't start
temporal-uibeforetemporalserver is ready - Don't start
temporalbeforepostgresis ready - The
depends_onconfiguration handles this, but manual starts can cause issues
- Don't start
-
Database Issues
- Don't delete the PostgreSQL container without backing up data
- Don't change database credentials after initial setup without updating all services
- Don't manually modify the Temporal database schema
-
Version Compatibility
- Don't mix incompatible versions of Temporal server and UI
- Don't upgrade major versions without checking migration guides
- Current versions: Server
1.23, UI2.21.3
-
Environment Variables
# β Wrong - Inconsistent database names POSTGRES_DB: temporal POSTGRES_SEEDS: different_postgres # β Correct - Consistent naming POSTGRES_DB: temporal POSTGRES_SEEDS: postgres
-
Network Issues
# β Wrong - External port in internal config TEMPORAL_ADDRESS: temporal:8235 # β Correct - Internal port for container communication TEMPORAL_ADDRESS: temporal:7233
-
Port Mappings
# β Wrong - Conflicting external ports ports: - "7233:7233" # Might conflict with existing Temporal # β Correct - Non-conflicting external ports ports: - "7234:7233" # External 7234 β Internal 7233
-
Data Loss Prevention
- Never run
docker-compose down -vin production - Don't delete volumes without proper backup
- Don't restart PostgreSQL container during active workflows
- Never run
-
Security Issues
- Don't expose database ports to the internet without proper security
- Don't use default credentials in production
- Don't disable authentication in production environments
-
Performance Issues
- Don't run with default resource limits in production
- Don't ignore container health checks
- Don't start workflows without proper monitoring
# Check container status
docker-compose ps
# View detailed logs
docker-compose logs temporal
docker-compose logs postgres
docker-compose logs temporal-ui
# Restart specific service
docker-compose restart temporal- Verify all containers are running:
docker-compose ps - Check if port 8235 is available:
netstat -an | grep 8235 - Wait for Temporal server to be fully initialized (30-60 seconds)
- Check UI logs:
docker-compose logs temporal-ui
- Ensure PostgreSQL is ready:
docker-compose logs postgres - Verify environment variables match between services
- Check if port 5433 is available for external connections
# Check what's using your ports
lsof -i :5433
lsof -i :7234
lsof -i :8235
# Change ports in docker-compose.yml if conflicts exist- Learn Temporal Concepts: Read about workflows, activities, and workers
- Choose Your SDK: Install Temporal SDK for your preferred language
- Build Your First Workflow: Start with simple examples
- Monitor with Web UI: Use http://localhost:8235 to observe execution
- Scale Your Setup: Consider clustering for production use
This setup configuration is provided as-is for development purposes.
Note: This setup is optimized for development. For production deployments, consider additional security, monitoring, and scaling configurations.