当前位置: 首页 > 工具软件 > Prefect > 使用案例 >

docker-compose搭建prefect2.0

轩辕庆
2023-12-01

Prefect 是一个新的工作流管理系统,专门为python开发的自动化任务编排工具。

官方地址:Prefect 2.0 

version: '3.7'
networks:
  prefect-server:
    name: prefect-server
service:
  prefect2:
    image: prefecthq/prefect:2.0.4-python3.9
    container_name: prefect2
    command: prefect orion start
    ports:
      - 4200:4200
    environment:
      PREFECT_ORION_DATABASE_CONNECTION_URL: postgresql+asyncpg://postgres:password@orion_postgres:5432/orion
      #监听主机地址
      PREFECT_ORION_API_HOST: 0.0.0.0
      #*.*.*.*需要写UI界面访问到服务器的IP地址
      PREFECT_API_URL: http://*.*.*.*:4200/api
    depends_on:
      - orion_postgres   
    networks:
      prefect-server: null

  orion_postgres: 
    container_name: orion_postgres
    image: postgres:14.5
    privileged: true 
    # 权限要加,不然启动会告错
    environment:
      POSTGRES_PASSWORD: password
      POSTGRES_USER:  postgres
      POSTGRES_DB: orion
      TZ: Asia/Shanghai
    volumes:
      - ./oriondb:/var/lib/postgresql/data
    networks:
      prefect-server: null

 类似资料: