Zuletzt aktiv 8 months ago

整合 PostgreSQL、Redis、MinIO、SMTP 與環境變數設定,支援 https、自動掛載資料夾、支援 Typebot Builder & Viewer,還有一鍵重啟腳本 🚀

Änderung a14026e78cee3d1f2d863ca6b0a2cca4fbe6d539

.env Originalformat
1# Secret key for encryption
2ENCRYPTION_SECRET=KPOUyIj9sZIafK2s+M61IDQOT5e6bYC6
3
4# PostgreSQL connection string
5DATABASE_URL=postgresql://postgres:typebot@typebot-db:5432/typebot
6
7# Optimize Node.js memory usage
8NODE_OPTIONS=--no-node-snapshot
9
10# Typebot URLs
11# NEXTAUTH_URL=http://localhost:8080
12# NEXTAUTH_URL=http://192.168.42.125:8080
13NEXTAUTH_URL=https://typebot.lotimmy.com/
14NEXT_PUBLIC_VIEWER_URL=http://localhost:8081
15
16# Authentication settings
17NEXTAUTH_SECRET=1sHGd7/dj2ex5utL9ii+sjITsZk8NeTYqmxktK+FjTQ=
18ADMIN_EMAIL=admin@example.com
19AUTH_EMAIL=true
20
21# SMTP settings for email verification
22SMTP_HOST=192.168.42.107 # Change this to your SMTP server
23SMTP_PORT=1025 # Use 465 for SSL, 587 for TLS, 25 for non-encrypted
24NEXT_PUBLIC_SMTP_FROM="Typebot Notifications <your-email@example.com>"
25SMTP_SECURE=false # Set to true for SSL
26
27SMTP_USERNAME=none
28SMTP_PASSWORD=none
29
30S3_ENDPOINT=192.168.42.125
31S3_PORT=9000
32S3_SSL=false
33S3_REGION=us-east-1
34S3_BUCKET=typebot-storage
35S3_ACCESS_KEY=minioAdmin
36S3_SECRET_KEY=G0dM!nS3cr3t2025
37
38
39ENABLE_PAYMENTS=false
40
41# Disable third-party logins
42AUTH_GOOGLE=false
43AUTH_GITHUB=false
44AUTH_FACEBOOK=false
docker-compose.yml Originalformat
1x-typebot-common: &typebot-common
2 restart: always
3 depends_on:
4 typebot-redis:
5 condition: service_healthy
6 typebot-db:
7 condition: service_healthy
8 typebot-minio:
9 condition: service_healthy
10 networks:
11 - typebot-network
12 env_file: .env
13 environment:
14 REDIS_URL: redis://typebot-redis:6379
15
16services:
17 typebot-db:
18 container_name: typebot-db
19 image: postgres:16
20 restart: always
21 volumes:
22 - ./db-data:/var/lib/postgresql/data
23 environment:
24 - POSTGRES_DB=typebot
25 - POSTGRES_USER=postgres
26 - POSTGRES_PASSWORD=typebot
27 healthcheck:
28 test: ["CMD-SHELL", "pg_isready -U postgres -d typebot"]
29 interval: 5s
30 timeout: 5s
31 retries: 10
32 networks:
33 - typebot-network
34
35 typebot-redis:
36 container_name: typebot-redis
37 image: redis:alpine
38 restart: always
39 command: --save 60 1 --loglevel warning
40 healthcheck:
41 test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
42 start_period: 20s
43 interval: 30s
44 retries: 5
45 timeout: 3s
46 volumes:
47 - ./redis-data:/data
48 networks:
49 - typebot-network
50
51 typebot-minio:
52 container_name: typebot-minio
53 image: minio/minio
54 restart: always
55 command: server /data --console-address ":9001"
56 environment:
57 - MINIO_ROOT_USER=minioAdmin
58 - MINIO_ROOT_PASSWORD=G0dM!nS3cr3t2025
59 volumes:
60 - ./minio-data:/data
61 ports:
62 - "9000:9000"
63 - "9001:9001"
64 networks:
65 - typebot-network
66 healthcheck:
67 test: ["CMD-SHELL", "curl -f http://localhost:9000/minio/health/live || exit 1"]
68 interval: 30s
69 timeout: 10s
70 retries: 5
71
72 typebot-builder:
73 container_name: typebot-builder
74 <<: *typebot-common
75 image: baptistearno/typebot-builder:latest
76 ports:
77 - "8080:3000"
78
79 typebot-viewer:
80 container_name: typebot-viewer
81 <<: *typebot-common
82 image: baptistearno/typebot-viewer:latest
83 ports:
84 - "8081:3000"
85
86networks:
87 typebot-network:
88 driver: bridge
restart-typebot.sh Originalformat
1#!/bin/bash
2
3echo "Stopping Typebot..."
4docker-compose down
5
6echo "Starting Typebot..."
7docker-compose up -d
8
9echo "Waiting for services to start..."
10sleep 5 # Wait 5 seconds for containers to start
11
12echo "Checking container status..."
13docker ps | grep typebot
14
15echo "Typebot restarted successfully!"