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.
25 lines
775 B
Text
25 lines
775 B
Text
# Pry — Apify Actor Dockerfile
|
|
# Lightweight image for Apify platform deployment.
|
|
# Unlike the main Dockerfile, this skips Playwright/Chromium
|
|
# (the Apify platform provides browser rendering via Puppeteer).
|
|
# Only the HTTP/TLS/cloudscraper tiers are available here.
|
|
FROM apify/actor-python:3.12
|
|
|
|
# Copy everything
|
|
COPY --chmod=755 . /usr/src/app
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
# Install runtime dependencies (no dev deps)
|
|
RUN pip install --no-cache-dir -r requirements.txt \
|
|
&& rm -rf /root/.cache
|
|
|
|
# Install Apify SDK (not in requirements.txt — only needed for the actor)
|
|
RUN pip install --no-cache-dir "apify~=1.7.0" \
|
|
&& rm -rf /root/.cache
|
|
|
|
# The actor entry point
|
|
ENV PRY_ACTOR=true
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
ENTRYPOINT ["python3", "/usr/src/app/.actor/src/main.py"]
|