feat(inngest): add Inngest service with configuration files, documentation, and Docker Compose setup
This commit is contained in:
@@ -65,6 +65,7 @@ These services require building custom Docker images from source.
|
||||
| [Harbor](./src/harbor) | v2.12.0 |
|
||||
| [HashiCorp Consul](./src/consul) | 1.20.3 |
|
||||
| [InfluxDB](./src/influxdb) | 2.8.0 |
|
||||
| [Inngest](./src/inngest) | v1.16.3 |
|
||||
| [Jenkins](./src/jenkins) | 2.541-lts |
|
||||
| [JODConverter](./src/jodconverter) | latest |
|
||||
| [Kestra](./src/kestra) | latest-full |
|
||||
|
||||
@@ -65,6 +65,7 @@ Compose Anything 通过提供一组高质量的 Docker Compose 配置文件,
|
||||
| [Harbor](./src/harbor) | v2.12.0 |
|
||||
| [HashiCorp Consul](./src/consul) | 1.20.3 |
|
||||
| [InfluxDB](./src/influxdb) | 2.8.0 |
|
||||
| [Inngest](./src/inngest) | v1.16.3 |
|
||||
| [Jenkins](./src/jenkins) | 2.541-lts |
|
||||
| [JODConverter](./src/jodconverter) | latest |
|
||||
| [Kestra](./src/kestra) | latest-full |
|
||||
|
||||
83
src/inngest/.env.example
Normal file
83
src/inngest/.env.example
Normal file
@@ -0,0 +1,83 @@
|
||||
# Global registry prefix for all images (optional)
|
||||
GLOBAL_REGISTRY=
|
||||
|
||||
# ============================================================
|
||||
# Inngest Configuration
|
||||
# ============================================================
|
||||
|
||||
# Inngest image version
|
||||
INNGEST_VERSION=v1.16.3
|
||||
|
||||
# Event key for authenticating event submissions (must be hex string with even number of chars)
|
||||
# Generate with: openssl rand -hex 32
|
||||
INNGEST_EVENT_KEY=deadbeefcafebabe0123456789abcdef
|
||||
|
||||
# Signing key for signing/validating data between server and apps (must be hex string with even number of chars)
|
||||
# Generate with: openssl rand -hex 32
|
||||
INNGEST_SIGNING_KEY=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
|
||||
|
||||
# Log level: trace, debug, info, warn, error
|
||||
INNGEST_LOG_LEVEL=info
|
||||
|
||||
# ============================================================
|
||||
# Port Configuration
|
||||
# ============================================================
|
||||
|
||||
# Inngest API and Dashboard port
|
||||
INNGEST_PORT_OVERRIDE=8288
|
||||
|
||||
# Inngest Connect WebSocket gateway port
|
||||
INNGEST_GATEWAY_PORT_OVERRIDE=8289
|
||||
|
||||
# ============================================================
|
||||
# PostgreSQL Configuration
|
||||
# ============================================================
|
||||
|
||||
# PostgreSQL image version
|
||||
INNGEST_PG_VERSION=17.6-alpine
|
||||
|
||||
# PostgreSQL credentials
|
||||
INNGEST_PG_USER=inngest
|
||||
INNGEST_PG_PASSWORD=inngest
|
||||
INNGEST_PG_DB=inngest
|
||||
|
||||
# ============================================================
|
||||
# Redis Configuration
|
||||
# ============================================================
|
||||
|
||||
# Redis image version
|
||||
INNGEST_REDIS_VERSION=7.4-alpine
|
||||
|
||||
# ============================================================
|
||||
# Timezone
|
||||
# ============================================================
|
||||
|
||||
# Timezone (e.g., UTC, Asia/Shanghai, America/New_York)
|
||||
TZ=UTC
|
||||
|
||||
# ============================================================
|
||||
# Resource Limits - Inngest
|
||||
# ============================================================
|
||||
|
||||
INNGEST_CPU_LIMIT=1.00
|
||||
INNGEST_CPU_RESERVATION=0.50
|
||||
INNGEST_MEMORY_LIMIT=512M
|
||||
INNGEST_MEMORY_RESERVATION=256M
|
||||
|
||||
# ============================================================
|
||||
# Resource Limits - PostgreSQL
|
||||
# ============================================================
|
||||
|
||||
INNGEST_PG_CPU_LIMIT=0.50
|
||||
INNGEST_PG_CPU_RESERVATION=0.25
|
||||
INNGEST_PG_MEMORY_LIMIT=256M
|
||||
INNGEST_PG_MEMORY_RESERVATION=128M
|
||||
|
||||
# ============================================================
|
||||
# Resource Limits - Redis
|
||||
# ============================================================
|
||||
|
||||
INNGEST_REDIS_CPU_LIMIT=0.50
|
||||
INNGEST_REDIS_CPU_RESERVATION=0.25
|
||||
INNGEST_REDIS_MEMORY_LIMIT=128M
|
||||
INNGEST_REDIS_MEMORY_RESERVATION=64M
|
||||
99
src/inngest/README.md
Normal file
99
src/inngest/README.md
Normal file
@@ -0,0 +1,99 @@
|
||||
# Inngest
|
||||
|
||||
[English](./README.md) | [中文](./README.zh.md)
|
||||
|
||||
[Inngest](https://www.inngest.com/) is an open-source durable workflow engine for building reliable applications. It provides event-driven functions with automatic retries, scheduling, fan-out, and a built-in dashboard for monitoring and debugging.
|
||||
|
||||
## Services
|
||||
|
||||
- `inngest`: Inngest server with API, Dashboard, and Connect WebSocket gateway (ports 8288, 8289)
|
||||
- `postgres`: PostgreSQL database for persistence
|
||||
- `redis`: Redis for queue and run state management
|
||||
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
# Copy environment file
|
||||
cp .env.example .env
|
||||
|
||||
# Start all services
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
After startup, access the Inngest Dashboard at `http://localhost:8288`.
|
||||
|
||||
## Environment Variables
|
||||
|
||||
| Variable Name | Description | Default Value |
|
||||
| ---------------------------------- | ---------------------------------------------------- | ------------- |
|
||||
| `GLOBAL_REGISTRY` | Global registry prefix for all images | `""` |
|
||||
| `INNGEST_VERSION` | Inngest image version | `v1.16.3` |
|
||||
| `INNGEST_EVENT_KEY` | Event key for authenticating event submissions (hex) | `deadbeef...` |
|
||||
| `INNGEST_SIGNING_KEY` | Signing key for server-app communication (hex) | `01234567...` |
|
||||
| `INNGEST_LOG_LEVEL` | Log level (trace, debug, info, warn, error) | `info` |
|
||||
| `INNGEST_PORT_OVERRIDE` | Host port for API and Dashboard | `8288` |
|
||||
| `INNGEST_GATEWAY_PORT_OVERRIDE` | Host port for Connect WebSocket gateway | `8289` |
|
||||
| `INNGEST_PG_VERSION` | PostgreSQL image version | `17.6-alpine` |
|
||||
| `INNGEST_PG_USER` | PostgreSQL username | `inngest` |
|
||||
| `INNGEST_PG_PASSWORD` | PostgreSQL password | `inngest` |
|
||||
| `INNGEST_PG_DB` | PostgreSQL database name | `inngest` |
|
||||
| `INNGEST_REDIS_VERSION` | Redis image version | `7.4-alpine` |
|
||||
| `TZ` | Timezone | `UTC` |
|
||||
| `INNGEST_CPU_LIMIT` | CPU limit for Inngest | `1.00` |
|
||||
| `INNGEST_CPU_RESERVATION` | CPU reservation for Inngest | `0.50` |
|
||||
| `INNGEST_MEMORY_LIMIT` | Memory limit for Inngest | `512M` |
|
||||
| `INNGEST_MEMORY_RESERVATION` | Memory reservation for Inngest | `256M` |
|
||||
| `INNGEST_PG_CPU_LIMIT` | CPU limit for PostgreSQL | `0.50` |
|
||||
| `INNGEST_PG_CPU_RESERVATION` | CPU reservation for PostgreSQL | `0.25` |
|
||||
| `INNGEST_PG_MEMORY_LIMIT` | Memory limit for PostgreSQL | `256M` |
|
||||
| `INNGEST_PG_MEMORY_RESERVATION` | Memory reservation for PostgreSQL | `128M` |
|
||||
| `INNGEST_REDIS_CPU_LIMIT` | CPU limit for Redis | `0.50` |
|
||||
| `INNGEST_REDIS_CPU_RESERVATION` | CPU reservation for Redis | `0.25` |
|
||||
| `INNGEST_REDIS_MEMORY_LIMIT` | Memory limit for Redis | `128M` |
|
||||
| `INNGEST_REDIS_MEMORY_RESERVATION` | Memory reservation for Redis | `64M` |
|
||||
|
||||
Please modify the `.env` file as needed for your use case.
|
||||
|
||||
## Volumes
|
||||
|
||||
- `inngest_pg_data`: Named volume for PostgreSQL data
|
||||
- `inngest_redis_data`: Named volume for Redis data
|
||||
|
||||
## Configuring Inngest SDKs
|
||||
|
||||
To connect your application to a self-hosted Inngest server, set the following environment variables in your app:
|
||||
|
||||
```bash
|
||||
INNGEST_EVENT_KEY=<your_event_key>
|
||||
INNGEST_SIGNING_KEY=<your_signing_key>
|
||||
INNGEST_DEV=0
|
||||
INNGEST_BASE_URL=http://<inngest_host>:8288
|
||||
```
|
||||
|
||||
For example, with a Node.js app:
|
||||
|
||||
```bash
|
||||
INNGEST_EVENT_KEY=deadbeefcafebabe0123456789abcdef \
|
||||
INNGEST_SIGNING_KEY=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
|
||||
INNGEST_DEV=0 \
|
||||
INNGEST_BASE_URL=http://localhost:8288 \
|
||||
node ./server.js
|
||||
```
|
||||
|
||||
## Security Notes
|
||||
|
||||
- **Change default keys before production use.** The event key and signing key must be valid hex strings with an even number of characters. Generate secure keys with `openssl rand -hex 32`.
|
||||
- **Change the default PostgreSQL password** in `.env` before production deployment.
|
||||
- The Inngest image supports both `amd64` and `arm64` architectures.
|
||||
- Consider using TLS/SSL termination (e.g., via a reverse proxy) for production deployments.
|
||||
|
||||
## References
|
||||
|
||||
- [Official Documentation](https://www.inngest.com/docs)
|
||||
- [Self-Hosting Guide](https://www.inngest.com/docs/self-hosting)
|
||||
- [GitHub Repository](https://github.com/inngest/inngest)
|
||||
- [SDK Documentation](https://www.inngest.com/docs/sdk/overview)
|
||||
|
||||
## License
|
||||
|
||||
Inngest is source-available under the [Elastic License 2.0 (ELv2)](https://github.com/inngest/inngest/blob/main/LICENSE.md) with some components under [Apache-2.0](https://github.com/inngest/inngest/blob/main/LICENSE-APACHE.md).
|
||||
99
src/inngest/README.zh.md
Normal file
99
src/inngest/README.zh.md
Normal file
@@ -0,0 +1,99 @@
|
||||
# Inngest
|
||||
|
||||
[English](./README.md) | [中文](./README.zh.md)
|
||||
|
||||
[Inngest](https://www.inngest.com/) 是一个开源的持久化工作流引擎,用于构建可靠的应用程序。它提供事件驱动的函数,支持自动重试、调度、扇出以及内置的监控和调试仪表板。
|
||||
|
||||
## 服务
|
||||
|
||||
- `inngest`:Inngest 服务器,包含 API、仪表板和 Connect WebSocket 网关(端口 8288、8289)
|
||||
- `postgres`:PostgreSQL 数据库,用于数据持久化
|
||||
- `redis`:Redis,用于队列和运行状态管理
|
||||
|
||||
## 快速开始
|
||||
|
||||
```bash
|
||||
# 复制环境配置文件
|
||||
copy .env.example .env
|
||||
|
||||
# 启动所有服务
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
启动后,通过 `http://localhost:8288` 访问 Inngest 仪表板。
|
||||
|
||||
## 环境变量
|
||||
|
||||
| 变量名 | 说明 | 默认值 |
|
||||
| ---------------------------------- | ------------------------------------------- | ------------- |
|
||||
| `GLOBAL_REGISTRY` | 全局镜像仓库前缀 | `""` |
|
||||
| `INNGEST_VERSION` | Inngest 镜像版本 | `v1.16.3` |
|
||||
| `INNGEST_EVENT_KEY` | 事件提交认证密钥(十六进制字符串) | `deadbeef...` |
|
||||
| `INNGEST_SIGNING_KEY` | 服务器与应用间的签名密钥(十六进制字符串) | `01234567...` |
|
||||
| `INNGEST_LOG_LEVEL` | 日志级别(trace、debug、info、warn、error) | `info` |
|
||||
| `INNGEST_PORT_OVERRIDE` | API 和仪表板的主机端口 | `8288` |
|
||||
| `INNGEST_GATEWAY_PORT_OVERRIDE` | Connect WebSocket 网关的主机端口 | `8289` |
|
||||
| `INNGEST_PG_VERSION` | PostgreSQL 镜像版本 | `17.6-alpine` |
|
||||
| `INNGEST_PG_USER` | PostgreSQL 用户名 | `inngest` |
|
||||
| `INNGEST_PG_PASSWORD` | PostgreSQL 密码 | `inngest` |
|
||||
| `INNGEST_PG_DB` | PostgreSQL 数据库名 | `inngest` |
|
||||
| `INNGEST_REDIS_VERSION` | Redis 镜像版本 | `7.4-alpine` |
|
||||
| `TZ` | 时区 | `UTC` |
|
||||
| `INNGEST_CPU_LIMIT` | Inngest CPU 限制 | `1.00` |
|
||||
| `INNGEST_CPU_RESERVATION` | Inngest CPU 预留 | `0.50` |
|
||||
| `INNGEST_MEMORY_LIMIT` | Inngest 内存限制 | `512M` |
|
||||
| `INNGEST_MEMORY_RESERVATION` | Inngest 内存预留 | `256M` |
|
||||
| `INNGEST_PG_CPU_LIMIT` | PostgreSQL CPU 限制 | `0.50` |
|
||||
| `INNGEST_PG_CPU_RESERVATION` | PostgreSQL CPU 预留 | `0.25` |
|
||||
| `INNGEST_PG_MEMORY_LIMIT` | PostgreSQL 内存限制 | `256M` |
|
||||
| `INNGEST_PG_MEMORY_RESERVATION` | PostgreSQL 内存预留 | `128M` |
|
||||
| `INNGEST_REDIS_CPU_LIMIT` | Redis CPU 限制 | `0.50` |
|
||||
| `INNGEST_REDIS_CPU_RESERVATION` | Redis CPU 预留 | `0.25` |
|
||||
| `INNGEST_REDIS_MEMORY_LIMIT` | Redis 内存限制 | `128M` |
|
||||
| `INNGEST_REDIS_MEMORY_RESERVATION` | Redis 内存预留 | `64M` |
|
||||
|
||||
请根据实际需求修改 `.env` 文件。
|
||||
|
||||
## 卷
|
||||
|
||||
- `inngest_pg_data`:用于存储 PostgreSQL 数据的命名卷
|
||||
- `inngest_redis_data`:用于存储 Redis 数据的命名卷
|
||||
|
||||
## 配置 Inngest SDK
|
||||
|
||||
要将你的应用连接到自托管的 Inngest 服务器,请在应用中设置以下环境变量:
|
||||
|
||||
```bash
|
||||
INNGEST_EVENT_KEY=<你的事件密钥>
|
||||
INNGEST_SIGNING_KEY=<你的签名密钥>
|
||||
INNGEST_DEV=0
|
||||
INNGEST_BASE_URL=http://<inngest_host>:8288
|
||||
```
|
||||
|
||||
例如,对于 Node.js 应用:
|
||||
|
||||
```bash
|
||||
INNGEST_EVENT_KEY=deadbeefcafebabe0123456789abcdef \
|
||||
INNGEST_SIGNING_KEY=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
|
||||
INNGEST_DEV=0 \
|
||||
INNGEST_BASE_URL=http://localhost:8288 \
|
||||
node ./server.js
|
||||
```
|
||||
|
||||
## 安全提示
|
||||
|
||||
- **生产环境使用前请务必更改默认密钥。** 事件密钥和签名密钥必须是偶数位的有效十六进制字符串。可使用 `openssl rand -hex 32` 生成安全密钥。
|
||||
- 生产环境部署前请在 `.env` 中**更改默认的 PostgreSQL 密码**。
|
||||
- Inngest 镜像支持 `amd64` 和 `arm64` 架构。
|
||||
- 生产环境建议使用 TLS/SSL 终止(例如通过反向代理)。
|
||||
|
||||
## 参考链接
|
||||
|
||||
- [官方文档](https://www.inngest.com/docs)
|
||||
- [自托管指南](https://www.inngest.com/docs/self-hosting)
|
||||
- [GitHub 仓库](https://github.com/inngest/inngest)
|
||||
- [SDK 文档](https://www.inngest.com/docs/sdk/overview)
|
||||
|
||||
## 许可证
|
||||
|
||||
Inngest 采用 [Elastic License 2.0(ELv2)](https://github.com/inngest/inngest/blob/main/LICENSE.md) 发布,部分组件采用 [Apache-2.0](https://github.com/inngest/inngest/blob/main/LICENSE-APACHE.md) 许可。
|
||||
147
src/inngest/docker-compose.yaml
Normal file
147
src/inngest/docker-compose.yaml
Normal file
@@ -0,0 +1,147 @@
|
||||
# Inngest - Durable workflow engine for building reliable applications
|
||||
# https://www.inngest.com/
|
||||
# https://github.com/inngest/inngest
|
||||
#
|
||||
# Features:
|
||||
# - Durable functions and workflows with automatic retries
|
||||
# - Event-driven architecture with fan-out and scheduling
|
||||
# - Built-in dashboard for monitoring and debugging
|
||||
# - Connect WebSocket gateway for SDK communication
|
||||
# - Supports PostgreSQL for persistence and Redis for queuing
|
||||
#
|
||||
# Default Ports:
|
||||
# - 8288: API and Dashboard
|
||||
# - 8289: Connect WebSocket gateway
|
||||
#
|
||||
# Default Credentials:
|
||||
# - PostgreSQL: inngest / inngest (database: inngest)
|
||||
# - Event Key: See .env.example (must be hex string with even number of chars)
|
||||
# - Signing Key: See .env.example (must be hex string with even number of chars)
|
||||
#
|
||||
# Security Notes:
|
||||
# - Change the default event key and signing key before production use
|
||||
# - Change the default PostgreSQL password before production use
|
||||
# - Both keys must be valid hex strings with an even number of characters
|
||||
# - Generate secure keys with: openssl rand -hex 32
|
||||
#
|
||||
# License: Apache-2.0 (Elastic License 2.0 for some components)
|
||||
|
||||
x-defaults: &defaults
|
||||
restart: unless-stopped
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: 100m
|
||||
max-file: "3"
|
||||
|
||||
services:
|
||||
inngest:
|
||||
<<: *defaults
|
||||
image: ${GLOBAL_REGISTRY:-}inngest/inngest:${INNGEST_VERSION:-v1.16.3}
|
||||
command: >
|
||||
inngest start
|
||||
--host 0.0.0.0
|
||||
--port 8288
|
||||
--connect-gateway-port 8289
|
||||
--postgres-uri postgresql://${INNGEST_PG_USER:-inngest}:${INNGEST_PG_PASSWORD:-inngest}@postgres:5432/${INNGEST_PG_DB:-inngest}?sslmode=disable
|
||||
--redis-uri redis://redis:6379
|
||||
ports:
|
||||
- "${INNGEST_PORT_OVERRIDE:-8288}:8288"
|
||||
- "${INNGEST_GATEWAY_PORT_OVERRIDE:-8289}:8289"
|
||||
environment:
|
||||
- TZ=${TZ:-UTC}
|
||||
- INNGEST_EVENT_KEY=${INNGEST_EVENT_KEY:-deadbeefcafebabe0123456789abcdef}
|
||||
- INNGEST_SIGNING_KEY=${INNGEST_SIGNING_KEY:-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef}
|
||||
- INNGEST_LOG_LEVEL=${INNGEST_LOG_LEVEL:-info}
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD",
|
||||
"wget",
|
||||
"--spider",
|
||||
"--quiet",
|
||||
"http://localhost:8288/v0/health",
|
||||
]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: ${INNGEST_CPU_LIMIT:-1.00}
|
||||
memory: ${INNGEST_MEMORY_LIMIT:-512M}
|
||||
reservations:
|
||||
cpus: ${INNGEST_CPU_RESERVATION:-0.50}
|
||||
memory: ${INNGEST_MEMORY_RESERVATION:-256M}
|
||||
|
||||
postgres:
|
||||
<<: *defaults
|
||||
image: ${GLOBAL_REGISTRY:-}postgres:${INNGEST_PG_VERSION:-17.6-alpine}
|
||||
volumes:
|
||||
- inngest_pg_data:/var/lib/postgresql/data
|
||||
environment:
|
||||
- TZ=${TZ:-UTC}
|
||||
- POSTGRES_USER=${INNGEST_PG_USER:-inngest}
|
||||
- POSTGRES_PASSWORD=${INNGEST_PG_PASSWORD:-inngest}
|
||||
- POSTGRES_DB=${INNGEST_PG_DB:-inngest}
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD-SHELL",
|
||||
"pg_isready -U ${INNGEST_PG_USER:-inngest} -d ${INNGEST_PG_DB:-inngest}",
|
||||
]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
cap_drop:
|
||||
- ALL
|
||||
cap_add:
|
||||
- CHOWN
|
||||
- DAC_READ_SEARCH
|
||||
- FOWNER
|
||||
- SETGID
|
||||
- SETUID
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: ${INNGEST_PG_CPU_LIMIT:-0.50}
|
||||
memory: ${INNGEST_PG_MEMORY_LIMIT:-256M}
|
||||
reservations:
|
||||
cpus: ${INNGEST_PG_CPU_RESERVATION:-0.25}
|
||||
memory: ${INNGEST_PG_MEMORY_RESERVATION:-128M}
|
||||
|
||||
redis:
|
||||
<<: *defaults
|
||||
image: ${GLOBAL_REGISTRY:-}redis:${INNGEST_REDIS_VERSION:-7.4-alpine}
|
||||
volumes:
|
||||
- inngest_redis_data:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 3
|
||||
start_period: 5s
|
||||
cap_drop:
|
||||
- ALL
|
||||
cap_add:
|
||||
- SETGID
|
||||
- SETUID
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: ${INNGEST_REDIS_CPU_LIMIT:-0.50}
|
||||
memory: ${INNGEST_REDIS_MEMORY_LIMIT:-128M}
|
||||
reservations:
|
||||
cpus: ${INNGEST_REDIS_CPU_RESERVATION:-0.25}
|
||||
memory: ${INNGEST_REDIS_MEMORY_RESERVATION:-64M}
|
||||
|
||||
volumes:
|
||||
inngest_pg_data:
|
||||
inngest_redis_data:
|
||||
Reference in New Issue
Block a user