Last active
March 10, 2026 02:18
-
-
Save slaveofcode/451b7cd861828d71d3f2699290faf942 to your computer and use it in GitHub Desktop.
Setup Postgres (18), Redis, Redpanda (Kafka) and Redis Console (Kafka UI) via Podman
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # ============================================================================= | |
| # Local Development Environment Teardown using Podman | |
| # ============================================================================= | |
| # | |
| # Service Port Reference (for reference): | |
| # +---------------+--------+--------------------------------------------------+ | |
| # | Service | Port(s)| Description | | |
| # +---------------+--------+--------------------------------------------------+ | |
| # | PostgreSQL | 5432 | Primary database | | |
| # | Redis | 6379 | Cache / Message broker | | |
| # | Redpanda | 9092 | Kafka-compatible streaming platform | | |
| # | Redpanda UI | 8080 | Redpanda Console Web UI | | |
| # | NSQ | 4150 | NSQD - Message queue | | |
| # | NSQLookupd | 4160 | Service discovery for NSQ | | |
| # | NATS | 4222 | NATS client connections (JetStream enabled) | | |
| # | NATS | 8222 | NATS HTTP monitoring | | |
| # | Elasticsearch | 9200 | Search and analytics engine | | |
| # | ClickHouse | 8123 | Columnar database (HTTP) | | |
| # | ClickHouse | 19000 | ClickHouse (TCP/Native) | | |
| # | MongoDB | 27017 | Document database | | |
| # | PeerDB | 7080 | PeerDB HTTP API | | |
| # | PeerDB UI | 3000 | PeerDB Web Interface | | |
| # | MinIO | 9000 | S3-compatible object storage (API) | | |
| # | MinIO | 9001 | MinIO Console | | |
| # | Temporal | 7233 | Temporal gRPC API | | |
| # | Temporal UI | 8088 | Temporal Web UI | | |
| # +---------------+--------+--------------------------------------------------+ | |
| # | |
| # Usage: | |
| # chmod +x ./dev-down.sh | |
| # ./dev-down.sh [OPTIONS] | |
| # | |
| # Options: | |
| # --all Stop all services (default if no flags provided) | |
| # --postgres Stop PostgreSQL | |
| # --redis Stop Redis | |
| # --redpanda Stop Redpanda + Redpanda Console | |
| # --nsq Stop NSQ + NSQLookupd | |
| # --nats Stop NATS | |
| # --elasticsearch Stop Elasticsearch | |
| # --clickhouse Stop ClickHouse | |
| # --mongodb Stop MongoDB | |
| # --peerdb Stop PeerDB Server + UI | |
| # --minio Stop MinIO | |
| # --temporal Stop Temporal + Temporal Web UI | |
| # --help, -h Show this help message | |
| # | |
| # Examples: | |
| # ./dev-down.sh # Stop all services | |
| # ./dev-down.sh --postgres # Stop only PostgreSQL | |
| # ./dev-down.sh --temporal # Stop Temporal | |
| # | |
| # Note: Data is preserved in: ~/podman/mnt | |
| # ============================================================================= | |
| # Parse flags | |
| STOP_ALL=false | |
| STOP_POSTGRES=false | |
| STOP_REDIS=false | |
| STOP_REDPANDA=false | |
| STOP_NSQ=false | |
| STOP_NATS=false | |
| STOP_ELASTIC=false | |
| STOP_CLICKHOUSE=false | |
| STOP_MONGODB=false | |
| STOP_PEERDB=false | |
| STOP_MINIO=false | |
| STOP_TEMPORAL=false | |
| for arg in "$@"; do | |
| case $arg in | |
| --all) | |
| STOP_ALL=true | |
| ;; | |
| --postgres) | |
| STOP_POSTGRES=true | |
| ;; | |
| --redis) | |
| STOP_REDIS=true | |
| ;; | |
| --redpanda) | |
| STOP_REDPANDA=true | |
| ;; | |
| --nsq) | |
| STOP_NSQ=true | |
| ;; | |
| --nats) | |
| STOP_NATS=true | |
| ;; | |
| --elasticsearch) | |
| STOP_ELASTIC=true | |
| ;; | |
| --clickhouse) | |
| STOP_CLICKHOUSE=true | |
| ;; | |
| --mongodb) | |
| STOP_MONGODB=true | |
| ;; | |
| --peerdb) | |
| STOP_PEERDB=true | |
| ;; | |
| --minio) | |
| STOP_MINIO=true | |
| ;; | |
| --temporal) | |
| STOP_TEMPORAL=true | |
| ;; | |
| --help|-h) | |
| echo "Local Development Environment Teardown" | |
| echo "" | |
| echo "Usage: $0 [OPTIONS]" | |
| echo "" | |
| echo "Options:" | |
| echo " --all Stop all services" | |
| echo " --postgres PostgreSQL (5432)" | |
| echo " --redis Redis (6379)" | |
| echo " --redpanda Redpanda + Console (9092, 8080)" | |
| echo " --nsq NSQ + NSQLookupd (4150, 4160)" | |
| echo " --nats NATS + JetStream (4222, 8222)" | |
| echo " --elasticsearch Elasticsearch (9200)" | |
| echo " --clickhouse ClickHouse (8123, 19000)" | |
| echo " --mongodb MongoDB (27017)" | |
| echo " --peerdb PeerDB Server + UI (7080, 3000)" | |
| echo " --minio MinIO (9000)" | |
| echo " --temporal Temporal + UI (7233, 8088)" | |
| echo "" | |
| echo "See script header for full documentation." | |
| exit 0 | |
| ;; | |
| *) | |
| echo "Error: unknown option '$arg'" | |
| echo "Run '$0 --help' for usage." | |
| exit 1 | |
| ;; | |
| esac | |
| done | |
| # Require at least one flag | |
| if [ "$STOP_ALL" = false ] && [ "$STOP_POSTGRES" = false ] && [ "$STOP_REDIS" = false ] && [ "$STOP_REDPANDA" = false ] && [ "$STOP_NSQ" = false ] && [ "$STOP_NATS" = false ] && [ "$STOP_ELASTIC" = false ] && [ "$STOP_CLICKHOUSE" = false ] && [ "$STOP_MONGODB" = false ] && [ "$STOP_PEERDB" = false ] && [ "$STOP_MINIO" = false ] && [ "$STOP_TEMPORAL" = false ]; then | |
| echo "No service specified. Use --all to stop everything, or --help for options." | |
| exit 1 | |
| fi | |
| CONTAINERS_TO_REMOVE="" | |
| add_containers() { | |
| for c in "$@"; do | |
| CONTAINERS_TO_REMOVE="$CONTAINERS_TO_REMOVE $c" | |
| done | |
| } | |
| if [ "$STOP_ALL" = true ] || [ "$STOP_POSTGRES" = true ]; then | |
| add_containers local-postgres | |
| fi | |
| if [ "$STOP_ALL" = true ] || [ "$STOP_REDIS" = true ]; then | |
| add_containers local-redis | |
| fi | |
| if [ "$STOP_ALL" = true ] || [ "$STOP_REDPANDA" = true ]; then | |
| add_containers local-redpanda redpanda-console | |
| fi | |
| if [ "$STOP_ALL" = true ] || [ "$STOP_NSQ" = true ]; then | |
| add_containers local-nsqlookupd local-nsqd | |
| fi | |
| if [ "$STOP_ALL" = true ] || [ "$STOP_NATS" = true ]; then | |
| add_containers local-nats | |
| fi | |
| if [ "$STOP_ALL" = true ] || [ "$STOP_ELASTIC" = true ]; then | |
| add_containers local-elasticsearch | |
| fi | |
| if [ "$STOP_ALL" = true ] || [ "$STOP_CLICKHOUSE" = true ]; then | |
| add_containers local-clickhouse | |
| fi | |
| if [ "$STOP_ALL" = true ] || [ "$STOP_MONGODB" = true ]; then | |
| add_containers local-mongodb | |
| fi | |
| if [ "$STOP_ALL" = true ] || [ "$STOP_MINIO" = true ]; then | |
| add_containers local-minio | |
| fi | |
| if [ "$STOP_ALL" = true ] || [ "$STOP_PEERDB" = true ]; then | |
| add_containers local-peerdb local-peerdb-ui | |
| fi | |
| if [ "$STOP_ALL" = true ] || [ "$STOP_TEMPORAL" = true ]; then | |
| add_containers local-temporal local-temporal-web | |
| fi | |
| echo "Stopping and removing containers..." | |
| podman rm -f $CONTAINERS_TO_REMOVE 2>/dev/null | |
| # Remove shared network when tearing down everything | |
| if [ "$STOP_ALL" = true ]; then | |
| podman network rm dev-net 2>/dev/null || true | |
| fi | |
| echo "Done. Data is still safe in $HOME/podman/mnt" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # ============================================================================= | |
| # Dev environment status checker | |
| # ============================================================================= | |
| # | |
| # Usage: | |
| # dev-stat.sh Show status of all known dev services | |
| # dev-stat.sh --stats Also show CPU and memory usage | |
| # dev-stat.sh --help Show this help message | |
| # ============================================================================= | |
| SHOW_STATS=false | |
| for arg in "$@"; do | |
| case $arg in | |
| --stats|-s) | |
| SHOW_STATS=true | |
| ;; | |
| --help|-h) | |
| echo "Usage: $(basename "$0") [--stats|-s]" | |
| echo "" | |
| echo "Options:" | |
| echo " --stats, -s Show CPU and memory usage for running containers" | |
| exit 0 | |
| ;; | |
| esac | |
| done | |
| # Color setup — respects NO_COLOR and non-TTY output | |
| if [ -t 1 ] && [ -z "${NO_COLOR:-}" ]; then | |
| GREEN='\033[0;32m' | |
| YELLOW='\033[0;33m' | |
| CYAN='\033[0;36m' | |
| DIM='\033[2m' | |
| BOLD='\033[1m' | |
| NC='\033[0m' | |
| else | |
| GREEN='' YELLOW='' CYAN='' DIM='' BOLD='' NC='' | |
| fi | |
| # Service definitions: "container|friendly_name|ports" | |
| # Lines starting with @ are group headers | |
| SERVICES=( | |
| "@Databases" | |
| "local-postgres|PostgreSQL|5432" | |
| "local-clickhouse|ClickHouse|8123, 19000" | |
| "local-mongodb|MongoDB|27017" | |
| "@Cache" | |
| "local-redis|Redis|6379" | |
| "@Messaging" | |
| "local-redpanda|Redpanda|9092, 9644" | |
| "redpanda-console|Redpanda UI|8080" | |
| "local-nsqlookupd|NSQLookupd|4160, 4161" | |
| "local-nsqd|NSQ|4150, 4151" | |
| "local-nats|NATS + JetStream|4222, 8222" | |
| "@Search" | |
| "local-elasticsearch|Elasticsearch|9200, 9300" | |
| "@Storage" | |
| "local-minio|MinIO|9000, 9001" | |
| "@PeerDB" | |
| "local-peerdb|PeerDB|7080, 7081" | |
| "local-peerdb-ui|PeerDB UI|3000" | |
| "@Temporal" | |
| "local-temporal|Temporal|7233" | |
| "local-temporal-web|Temporal UI|8088" | |
| ) | |
| # Fetch all container statuses at once (stored as plain string, grep per lookup) | |
| PS_OUTPUT=$(podman ps -a --format '{{.Names}}|{{.Status}}' 2>/dev/null) | |
| get_status() { | |
| echo "$PS_OUTPUT" | grep "^${1}|" | cut -d'|' -f2- | |
| } | |
| # Network status — single call, reuse result for both existence check and count | |
| echo "" | |
| connected=$(podman network inspect dev-net --format '{{len .Containers}}' 2>/dev/null) | |
| if [ -n "$connected" ]; then | |
| printf " ${BOLD}Network${NC} ${GREEN}dev-net active${NC} ${DIM}(%s containers connected)${NC}\n" "$connected" | |
| else | |
| printf " ${BOLD}Network${NC} ${DIM}dev-net not found${NC} — run dev-up.sh to create\n" | |
| fi | |
| echo "" | |
| # Table header | |
| printf " ${BOLD}%-22s %-20s %-16s %s${NC}\n" "SERVICE" "CONTAINER" "PORT(S)" "STATUS" | |
| printf " ${DIM}%-22s %-20s %-16s %s${NC}\n" "-------" "---------" "-------" "------" | |
| running=0; stopped=0; missing=0 | |
| for entry in "${SERVICES[@]}"; do | |
| # Group header | |
| if [[ "$entry" == @* ]]; then | |
| printf "\n ${CYAN}${DIM}%s${NC}\n" "${entry:1}" | |
| continue | |
| fi | |
| IFS='|' read -r container service ports <<< "$entry" | |
| raw=$(get_status "$container") | |
| if [ -z "$raw" ]; then | |
| label="${DIM}missing${NC}" | |
| ((missing++)) | |
| elif [[ "$raw" == Up* ]]; then | |
| label="${GREEN}up ${raw#Up }${NC}" | |
| ((running++)) | |
| else | |
| label="${YELLOW}${raw}${NC}" | |
| ((stopped++)) | |
| fi | |
| printf " %-22s %-20s %-16s " "$service" "$container" "$ports" | |
| echo -e "$label" | |
| done | |
| echo "" | |
| printf " Running ${GREEN}%d${NC} Stopped ${YELLOW}%d${NC} Missing ${DIM}%d${NC}\n" \ | |
| "$running" "$stopped" "$missing" | |
| echo "" | |
| # Resource usage (--stats) | |
| if [ "$SHOW_STATS" = true ]; then | |
| printf " ${BOLD}Resource Usage${NC}\n\n" | |
| podman stats --no-stream \ | |
| --format " {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.MemPerc}}" \ | |
| 2>/dev/null || true | |
| echo "" | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # ============================================================================= | |
| # Local Development Environment Setup using Podman | |
| # ============================================================================= | |
| # | |
| # Service Port Reference: | |
| # +---------------+--------+--------------------------------------------------+ | |
| # | Service | Port(s)| Description | | |
| # +---------------+--------+--------------------------------------------------+ | |
| # | PostgreSQL | 5432 | Primary database | | |
| # | Redis | 6379 | Cache / Message broker | | |
| # | Redpanda | 9092 | Kafka-compatible streaming platform | | |
| # | Redpanda UI | 8080 | Redpanda Console Web UI | | |
| # | Redpanda | 9644 | Admin API | | |
| # | NSQ | 4150 | NSQD - Message queue | | |
| # | NSQLookupd | 4160 | Service discovery for NSQ | | |
| # | NATS | 4222 | NATS client connections (JetStream enabled) | | |
| # | NATS | 8222 | NATS HTTP monitoring | | |
| # | Elasticsearch | 9200 | Search and analytics engine | | |
| # | ClickHouse | 8123 | Columnar database (HTTP) | | |
| # | ClickHouse | 19000 | ClickHouse (TCP/Native) — remapped from 9000 | | |
| # | MongoDB | 27017 | Document database | | |
| # | PeerDB | 7080 | PeerDB HTTP API | | |
| # | PeerDB | 7081 | PeerDB gRPC | | |
| # | PeerDB UI | 3000 | PeerDB Web Interface | | |
| # | MinIO | 9000 | S3-compatible object storage (API) | | |
| # | MinIO | 9001 | MinIO Console | | |
| # | Temporal | 7233 | Temporal gRPC API | | |
| # | Temporal UI | 8088 | Temporal Web UI | | |
| # +---------------+--------+--------------------------------------------------+ | |
| # | |
| # Usage: | |
| # chmod +x ./dev-up.sh | |
| # ./dev-up.sh [OPTIONS] | |
| # | |
| # Options: | |
| # --all Start all services (default if no flags provided) | |
| # --postgres PostgreSQL 18 (port 5432) | |
| # --redis Redis (port 6379) | |
| # --redpanda Redpanda + Redpanda Console (ports 9092, 9644, 8080) | |
| # --nsq NSQ + NSQLookupd (ports 4150, 4151, 4160, 4161) | |
| # --nats NATS + JetStream (ports 4222, 8222) | |
| # --elasticsearch Elasticsearch (ports 9200, 9300) | |
| # --clickhouse ClickHouse (ports 8123, 19000) | |
| # --mongodb MongoDB (port 27017) | |
| # --peerdb PeerDB Server + UI (ports 7080, 7081, 3000) | |
| # --minio MinIO S3 (ports 9000, 9001) | |
| # --temporal Temporal + Temporal Web UI (ports 7233, 8088) | |
| # --help, -h Show this help message | |
| # | |
| # Examples: | |
| # ./dev-up.sh # Start all services | |
| # ./dev-up.sh --postgres # Start only PostgreSQL | |
| # ./dev-up.sh --postgres --redis # Start PostgreSQL and Redis | |
| # ./dev-up.sh --temporal # Start Temporal (requires PostgreSQL) | |
| # ./dev-up.sh --peerdb # Start PeerDB (requires PostgreSQL, MinIO, NSQ) | |
| # | |
| # Dependencies: | |
| # - PeerDB requires: PostgreSQL, MinIO, NSQ | |
| # - Temporal requires: PostgreSQL | |
| # | |
| # Data is persisted in: ~/podman/mnt | |
| # Config files in: ~/podman/config | |
| # ============================================================================= | |
| # Configuration: Specific directories for data | |
| DATA_ROOT="$HOME/podman/mnt" | |
| CONFIG_DIR="$HOME/podman/config" | |
| POSTGRES_DIR="$DATA_ROOT/postgres" | |
| REDIS_DIR="$DATA_ROOT/redis" | |
| REDPANDA_DIR="$DATA_ROOT/redpanda" | |
| NSQ_DIR="$DATA_ROOT/nsq" | |
| NATS_DIR="$DATA_ROOT/nats" | |
| ELASTIC_DIR="$DATA_ROOT/elasticsearch" | |
| CLICKHOUSE_DIR="$DATA_ROOT/clickhouse" | |
| MONGODB_DIR="$DATA_ROOT/mongodb" | |
| MINIO_DIR="$DATA_ROOT/minio" | |
| TEMPORAL_DIR="$DATA_ROOT/temporal" | |
| # Create data directories if they don't exist | |
| mkdir -p "$POSTGRES_DIR" "$REDIS_DIR" "$REDPANDA_DIR" "$NSQ_DIR" "$NATS_DIR" "$ELASTIC_DIR" "$CLICKHOUSE_DIR" "$MONGODB_DIR" "$MINIO_DIR" "$TEMPORAL_DIR" | |
| # Create Temporal dynamic config if it doesn't exist | |
| mkdir -p "$CONFIG_DIR/dynamicconfig" | |
| if [ ! -f "$CONFIG_DIR/dynamicconfig/development.yaml" ]; then | |
| cat > "$CONFIG_DIR/dynamicconfig/development.yaml" <<'EOF' | |
| # Temporal dynamic configuration for local development | |
| EOF | |
| fi | |
| # Create shared container network if it doesn't exist | |
| podman network create dev-net 2>/dev/null || true | |
| # Parse flags | |
| START_ALL=false | |
| START_POSTGRES=false | |
| START_REDIS=false | |
| START_REDPANDA=false | |
| START_NSQ=false | |
| START_NATS=false | |
| START_ELASTIC=false | |
| START_CLICKHOUSE=false | |
| START_MONGODB=false | |
| START_PEERDB=false | |
| START_MINIO=false | |
| START_TEMPORAL=false | |
| for arg in "$@"; do | |
| case $arg in | |
| --all) | |
| START_ALL=true | |
| ;; | |
| --postgres) | |
| START_POSTGRES=true | |
| ;; | |
| --redis) | |
| START_REDIS=true | |
| ;; | |
| --redpanda) | |
| START_REDPANDA=true | |
| ;; | |
| --nsq) | |
| START_NSQ=true | |
| ;; | |
| --nats) | |
| START_NATS=true | |
| ;; | |
| --elasticsearch) | |
| START_ELASTIC=true | |
| ;; | |
| --clickhouse) | |
| START_CLICKHOUSE=true | |
| ;; | |
| --mongodb) | |
| START_MONGODB=true | |
| ;; | |
| --peerdb) | |
| START_PEERDB=true | |
| ;; | |
| --minio) | |
| START_MINIO=true | |
| ;; | |
| --temporal) | |
| START_TEMPORAL=true | |
| ;; | |
| --help|-h) | |
| echo "Local Development Environment Setup" | |
| echo "" | |
| echo "Usage: $0 [OPTIONS]" | |
| echo "" | |
| echo "Options:" | |
| echo " --all Start all services" | |
| echo " --postgres PostgreSQL (5432)" | |
| echo " --redis Redis (6379)" | |
| echo " --redpanda Redpanda + Console (9092, 8080)" | |
| echo " --nsq NSQ + NSQLookupd (4150, 4160)" | |
| echo " --nats NATS + JetStream (4222, 8222)" | |
| echo " --elasticsearch Elasticsearch (9200)" | |
| echo " --clickhouse ClickHouse (8123, 19000)" | |
| echo " --mongodb MongoDB (27017)" | |
| echo " --peerdb PeerDB Server + UI (7080, 3000)" | |
| echo " --minio MinIO (9000)" | |
| echo " --temporal Temporal + UI (7233, 8088)" | |
| echo "" | |
| echo "See script header for full documentation." | |
| exit 0 | |
| ;; | |
| *) | |
| echo "Error: unknown option '$arg'" | |
| echo "Run '$0 --help' for usage." | |
| exit 1 | |
| ;; | |
| esac | |
| done | |
| # Require at least one flag | |
| if [ "$START_ALL" = false ] && [ "$START_POSTGRES" = false ] && [ "$START_REDIS" = false ] && [ "$START_REDPANDA" = false ] && [ "$START_NSQ" = false ] && [ "$START_NATS" = false ] && [ "$START_ELASTIC" = false ] && [ "$START_CLICKHOUSE" = false ] && [ "$START_MONGODB" = false ] && [ "$START_PEERDB" = false ] && [ "$START_MINIO" = false ] && [ "$START_TEMPORAL" = false ]; then | |
| echo "No service specified. Use --all to start everything, or --help for options." | |
| exit 1 | |
| fi | |
| # Wait for a TCP port to become reachable (enforces service startup dependencies) | |
| wait_for_port() { | |
| local host=$1 | |
| local port=$2 | |
| local name=$3 | |
| local retries=30 | |
| echo " Waiting for $name ($host:$port)..." | |
| for i in $(seq 1 $retries); do | |
| if bash -c "echo >/dev/tcp/$host/$port" 2>/dev/null; then | |
| echo " $name is ready." | |
| return 0 | |
| fi | |
| sleep 2 | |
| done | |
| echo " WARNING: $name did not become ready after $((retries * 2))s, continuing anyway." | |
| } | |
| echo "Starting local dev environment..." | |
| # 1. PostgreSQL | |
| if [ "$START_ALL" = true ] || [ "$START_POSTGRES" = true ]; then | |
| podman rm -f local-postgres 2>/dev/null | |
| podman run -d \ | |
| --name local-postgres \ | |
| --network dev-net \ | |
| --restart=unless-stopped \ | |
| -e POSTGRES_PASSWORD=mamamia \ | |
| -p 5432:5432 \ | |
| -v "$POSTGRES_DIR":/var/lib/postgresql:Z \ | |
| docker.io/library/postgres:latest | |
| fi | |
| # 2. Redis | |
| if [ "$START_ALL" = true ] || [ "$START_REDIS" = true ]; then | |
| podman rm -f local-redis 2>/dev/null | |
| podman run -d \ | |
| --name local-redis \ | |
| --network dev-net \ | |
| --restart=unless-stopped \ | |
| -p 6379:6379 \ | |
| -v "$REDIS_DIR":/data:Z \ | |
| redis redis-server --save 60 1 | |
| fi | |
| # 3. Redpanda | |
| if [ "$START_ALL" = true ] || [ "$START_REDPANDA" = true ]; then | |
| podman rm -f local-redpanda 2>/dev/null | |
| podman run -d \ | |
| --name local-redpanda \ | |
| --network dev-net \ | |
| --restart=unless-stopped \ | |
| -p 9092:9092 -p 9644:9644 \ | |
| -v "$REDPANDA_DIR":/var/lib/redpanda/data:Z \ | |
| docker.io/redpandadata/redpanda:latest \ | |
| redpanda start \ | |
| --mode dev-container \ | |
| --smp 1 \ | |
| --memory 1G \ | |
| --kafka-addr PLAINTEXT://0.0.0.0:9092 \ | |
| --advertise-kafka-addr PLAINTEXT://localhost:9092 | |
| # 4. Redpanda Console (Web UI) | |
| podman rm -f redpanda-console 2>/dev/null | |
| podman run -d \ | |
| --name redpanda-console \ | |
| --network dev-net \ | |
| --restart=unless-stopped \ | |
| -p 8080:8080 \ | |
| -e KAFKA_BROKERS=local-redpanda:9092 \ | |
| docker.io/redpandadata/console:latest | |
| fi | |
| # 5. NSQ | |
| if [ "$START_ALL" = true ] || [ "$START_NSQ" = true ]; then | |
| podman rm -f local-nsqlookupd 2>/dev/null | |
| podman run -d \ | |
| --name local-nsqlookupd \ | |
| --network dev-net \ | |
| --restart=unless-stopped \ | |
| -p 4160:4160 -p 4161:4161 \ | |
| nsqio/nsq:latest \ | |
| /nsqlookupd | |
| podman rm -f local-nsqd 2>/dev/null | |
| podman run -d \ | |
| --name local-nsqd \ | |
| --network dev-net \ | |
| --restart=unless-stopped \ | |
| -p 4150:4150 -p 4151:4151 \ | |
| -v "$NSQ_DIR":/var/lib/nsq:Z \ | |
| nsqio/nsq:latest \ | |
| /nsqd \ | |
| --broadcast-address=localhost \ | |
| --lookupd-tcp-address=local-nsqlookupd:4160 | |
| fi | |
| # 6. NATS (JetStream enabled) | |
| if [ "$START_ALL" = true ] || [ "$START_NATS" = true ]; then | |
| podman rm -f local-nats 2>/dev/null | |
| podman run -d \ | |
| --name local-nats \ | |
| --network dev-net \ | |
| --restart=unless-stopped \ | |
| -p 4222:4222 -p 8222:8222 \ | |
| -v "$NATS_DIR":/data:Z \ | |
| docker.io/library/nats:latest \ | |
| -js -sd /data -p 4222 -m 8222 | |
| fi | |
| # 7. Elasticsearch | |
| if [ "$START_ALL" = true ] || [ "$START_ELASTIC" = true ]; then | |
| podman rm -f local-elasticsearch 2>/dev/null | |
| podman run -d \ | |
| --name local-elasticsearch \ | |
| --network dev-net \ | |
| --restart=unless-stopped \ | |
| -p 9200:9200 -p 9300:9300 \ | |
| -e discovery.type=single-node \ | |
| -e xpack.security.enabled=false \ | |
| -e "ES_JAVA_OPTS=-Xms512m -Xmx512m" \ | |
| -v "$ELASTIC_DIR":/usr/share/elasticsearch/data:Z \ | |
| docker.io/elastic/elasticsearch:8.11.0 | |
| fi | |
| # 8. ClickHouse (TCP/Native port remapped to 19000 to avoid conflict with MinIO on 9000) | |
| if [ "$START_ALL" = true ] || [ "$START_CLICKHOUSE" = true ]; then | |
| podman rm -f local-clickhouse 2>/dev/null | |
| podman run -d \ | |
| --name local-clickhouse \ | |
| --network dev-net \ | |
| --restart=unless-stopped \ | |
| -p 8123:8123 -p 19000:9000 \ | |
| -e CLICKHOUSE_DB=default \ | |
| -e CLICKHOUSE_USER=admin \ | |
| -e CLICKHOUSE_PASSWORD=mamamia \ | |
| -v "$CLICKHOUSE_DIR":/var/lib/clickhouse:Z \ | |
| clickhouse/clickhouse-server:latest | |
| fi | |
| # 9. MongoDB | |
| if [ "$START_ALL" = true ] || [ "$START_MONGODB" = true ]; then | |
| podman rm -f local-mongodb 2>/dev/null | |
| podman run -d \ | |
| --name local-mongodb \ | |
| --network dev-net \ | |
| --restart=unless-stopped \ | |
| -p 27017:27017 \ | |
| -e MONGO_INITDB_ROOT_USERNAME=admin \ | |
| -e MONGO_INITDB_ROOT_PASSWORD=mamamia \ | |
| -v "$MONGODB_DIR":/data/db:Z \ | |
| docker.io/library/mongo:latest | |
| fi | |
| # 10. MinIO | |
| if [ "$START_ALL" = true ] || [ "$START_MINIO" = true ]; then | |
| podman rm -f local-minio 2>/dev/null | |
| podman run -d \ | |
| --name local-minio \ | |
| --network dev-net \ | |
| --restart=unless-stopped \ | |
| -p 9000:9000 -p 9001:9001 \ | |
| -e MINIO_ROOT_USER=minioadmin \ | |
| -e MINIO_ROOT_PASSWORD=minioadmin \ | |
| -v "$MINIO_DIR":/data:Z \ | |
| minio/minio:latest \ | |
| server /data --console-address ":9001" | |
| fi | |
| # 11. PeerDB (requires postgres + minio + nsq) | |
| if [ "$START_ALL" = true ] || [ "$START_PEERDB" = true ]; then | |
| wait_for_port localhost 5432 "PostgreSQL" | |
| wait_for_port localhost 9000 "MinIO" | |
| wait_for_port localhost 4150 "NSQ" | |
| podman rm -f local-peerdb 2>/dev/null | |
| podman run -d \ | |
| --name local-peerdb \ | |
| --network dev-net \ | |
| --restart=unless-stopped \ | |
| -p 7080:7080 -p 7081:7081 \ | |
| -e PEERDB_HTTP_PORT=7080 \ | |
| -e PEERDB_GRPC_PORT=7081 \ | |
| -e PEERDB_POSTGRES_HOST=local-postgres \ | |
| -e PEERDB_POSTGRES_PORT=5432 \ | |
| -e PEERDB_POSTGRES_USER=postgres \ | |
| -e PEERDB_POSTGRES_PASSWORD=mamamia \ | |
| -e PEERDB_POSTGRES_DATABASE=postgres \ | |
| -e PEERDB_S3_HOST=local-minio \ | |
| -e PEERDB_S3_PORT=9000 \ | |
| -e PEERDB_S3_BUCKET=peerdb \ | |
| -e PEERDB_S3_ACCESS_KEY=minioadmin \ | |
| -e PEERDB_S3_SECRET_KEY=minioadmin \ | |
| -e PEERDB_S3_REGION=us-east-1 \ | |
| -e PEERDB_S3_PATH_STYLE=true \ | |
| -e PEERDB_S3_USE_SSL=false \ | |
| -e PEERBOX_CLI_VERSION=latest \ | |
| peerdb/peerdb-server:latest | |
| # PeerDB UI | |
| podman rm -f local-peerdb-ui 2>/dev/null | |
| podman run -d \ | |
| --name local-peerdb-ui \ | |
| --network dev-net \ | |
| --restart=unless-stopped \ | |
| -p 3000:3000 \ | |
| -e PEERDB_SERVER_ADDRESS=local-peerdb:7080 \ | |
| peerdb/peerdb-ui:latest | |
| fi | |
| # 12. Temporal (requires postgres) | |
| if [ "$START_ALL" = true ] || [ "$START_TEMPORAL" = true ]; then | |
| wait_for_port localhost 5432 "PostgreSQL" | |
| podman rm -f local-temporal 2>/dev/null | |
| podman run -d \ | |
| --name local-temporal \ | |
| --network dev-net \ | |
| --restart=unless-stopped \ | |
| -p 7233:7233 \ | |
| -e DB=postgresql \ | |
| -e DB_PORT=5432 \ | |
| -e POSTGRES_USER=postgres \ | |
| -e POSTGRES_PWD=mamamia \ | |
| -e POSTGRES_SEEDS=local-postgres \ | |
| -e DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development.yaml \ | |
| -e TEMPORAL_ADDRESS=local-temporal:7233 \ | |
| -v "$CONFIG_DIR":/etc/temporal/config:Z \ | |
| temporalio/server:latest | |
| # Temporal Web UI | |
| podman rm -f local-temporal-web 2>/dev/null | |
| podman run -d \ | |
| --name local-temporal-web \ | |
| --network dev-net \ | |
| --restart=unless-stopped \ | |
| -p 8088:8088 \ | |
| -e TEMPORAL_ADDRESS=local-temporal:7233 \ | |
| -e TEMPORAL_UI_PORT=8088 \ | |
| temporalio/ui:latest | |
| fi | |
| echo "Services started! Run 'dev-stat.sh' to check status." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment