Sophia Alice
09/26/2023, 9:22 PMMiguel Martinez
10/09/2023, 11:53 PMSophia Alice
10/09/2023, 11:54 PMMiguel Martinez
10/09/2023, 11:57 PMservices:
server:
container_name: prefect-server
image: prefecthq/prefect:2-python3.10
restart: unless-stopped
volumes:
- ./server:/root/.prefect
- /home/data/flows:/opt/prefect/flows
entrypoint: ["prefect", "server", "start"]
# command: bash -c "python /opt/prefect/flows/deployment-local.py"
environment:
- PREFECT_SERVER_API_HOST=0.0.0.0
- PREFECT_API_DATABASE_CONNECTION_URL=<postgresql+asyncpg://postgres:postgres@db:5432/prefect>
# - PREFECT_API_URL="<http://127.0.0.1:4210/api>"
# - PREFECT_UI_URL=<http://127.0.0.1:4200/api>
ports:
- 4200:4200
depends_on:
- db
agent:
container_name: prefect-agent
image: prefecthq/prefect:2-python3.10
restart: unless-stopped
entrypoint: ["/opt/prefect/entrypoint.sh", "prefect", "agent", "start", "-q", "default"]
environment:
- PREFECT_API_URL=<http://server:4200/api>
# Use PREFECT_API_KEY if connecting the agent to Prefect Cloud
# - PREFECT_API_KEY=YOUR_API_KEY
depends_on:
- server
db:
container_name: prefect-database
image: postgres:16-bookworm
restart: unless-stopped
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=prefect
expose:
- 5432
volumes:
- ./postgres:/var/lib/postgresql/data
Miguel Martinez
10/09/2023, 11:57 PMdocker compose up -d
Miguel Martinez
10/09/2023, 11:58 PMSophia Alice
10/10/2023, 12:56 AMSergey
10/18/2023, 8:41 AM