feat(apify): .actor/ scaffold (.actor/src/main.py + Dockerfile entrypoint swap + make actor-build)

The Apify platform expects the actor entry at .actor/src/main.py. Until
now Pry used `python -m apify_actor` via Dockerfile.apify, which works
but doesn't match the documented convention used by every other actor
on the platform.

  - Add .actor/src/main.py as a thin asyncio wrapper around apify_actor.main()
  - Swap Dockerfile.apify ENTRYPOINT to the new path
  - Add `make actor-build` Makefile target that regenerates
    .actor/input_schema.json from the ApifySchemaBuilder fluent API
    (urls, max_pages, timeout, output_format, crawl)

Conflicts: none — .actor/actor.json (full version:3.0.0 schema with
input/output blocks inline) already existed from earlier work; this
commit adds the conventional entry path and a build hook that emits
the schema as a sibling file. Apify Console accepts either form.
This commit is contained in:
opencode 2026-07-06 20:36:17 +07:00
parent cf376ab3a8
commit 372ce228f4
4 changed files with 90 additions and 12 deletions

View file

@ -22,4 +22,4 @@ RUN pip install --no-cache-dir "apify~=1.7.0" \
ENV PRY_ACTOR=true
ENV PYTHONUNBUFFERED=1
ENTRYPOINT ["python3", "-m", "apify_actor"]
ENTRYPOINT ["python3", "/usr/src/app/.actor/src/main.py"]