# Apify Actor image for skill-to-mcp.
# Builds the skill-to-mcp package and runs the Actor entry point
# (skill_to_mcp/actor.py -> main()), NOT the CLI.
FROM apify/actor-python:3.12

# Copy only the metadata first to leverage Docker layer caching.
COPY pyproject.toml README.md ./

# Copy the package source.
COPY skill_to_mcp ./skill_to_mcp

# Install the package together with the Apify SDK extra.
# The apify/actor-python base image already ships the Apify SDK, but we
# install the pinned extra to keep the build self-contained.
RUN echo "Python version:" \
 && python3 --version \
 && echo "Installing skill-to-mcp and dependencies:" \
 && pip install --no-cache-dir ".[apify]" \
 && echo "All installed packages:" \
 && pip freeze

# Run the Apify Actor entry point (asyncio.run(main())).
CMD ["python3", "-m", "skill_to_mcp.actor"]
