前提条件

  • Docker Engine 24+
  • Docker Compose v2+
  • PostgreSQL 14+
  • Redis 7+

docker-compose.yml

version: "3.8"
services:
  activepieces:
    image: ghcr.io/activepieces/activepieces:latest
    ports:
      - "8080:80"
    environment:
      AP_ENCRYPTION_KEY: "${AP_ENCRYPTION_KEY}"
      AP_JWT_SECRET: "${AP_JWT_SECRET}"
      AP_POSTGRES_DATABASE_URL: "postgresql://${DB_USER}:${DB_PASS}@postgres:5432/activepieces"
      AP_REDIS_URL: "redis://redis:6379"
      AP_SIGN_UP_ENABLED: "false"
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_started
    restart: unless-stopped

  postgres:
    image: postgres:16-alpine
    environment:
      POSTGRES_DB: activepieces
      POSTGRES_USER: "${DB_USER}"
      POSTGRES_PASSWORD: "${DB_PASS}"
    volumes:
      - pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d activepieces"]
      interval: 10s
    restart: unless-stopped

  redis:
    image: redis:7-alpine
    volumes:
      - redisdata:/data
    restart: unless-stopped

volumes:
  pgdata:
  redisdata:

环境变量

# .env 文件
AP_ENCRYPTION_KEY=$(openssl rand -hex 32)
AP_JWT_SECRET=$(openssl rand -hex 32)
DB_USER=ap
DB_PASS=$(openssl rand -hex 16)

启动

docker compose up -d

生产部署的完整配置项请查看配置项参考