baa3c2434f
Build and Deploy / build-and-deploy (push) Successful in 1m55s
- scripts/scrape-recipe: Python script using recipe-scrapers to extract schema.org JSON-LD from a recipe URL (or local HTML file for testing) - Dockerfile: add Python3 + recipe-scrapers in virtualenv, install the scrape-recipe script at /usr/local/bin/scrape-recipe
30 lines
1019 B
Docker
30 lines
1019 B
Docker
FROM debian:bookworm-slim
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
ca-certificates curl python3 python3-pip python3-venv tini && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install recipe-scrapers in a virtualenv to isolate dependencies.
|
|
RUN python3 -m venv /opt/roux-venv && \
|
|
/opt/roux-venv/bin/pip install --no-cache-dir recipe-scrapers==15.11.0 && \
|
|
rm -rf /root/.cache/pip
|
|
|
|
# Build timestamp — read at runtime for diagnostics.
|
|
RUN mkdir -p /build && date -u '+%Y-%m-%d %H:%M UTC' > /build/build-time
|
|
|
|
ADD roux-server /usr/local/bin/roux-server
|
|
ADD scripts/scrape-recipe /usr/local/bin/scrape-recipe
|
|
|
|
RUN chmod +x /usr/local/bin/roux-server /usr/local/bin/scrape-recipe
|
|
ENV PATH="/opt/roux-venv/bin:${PATH}"
|
|
|
|
ENTRYPOINT ["/usr/bin/tini", "-s", "--"]
|
|
|
|
# Recipes are mounted at /recipes at runtime via docker-compose volume mount.
|
|
RUN mkdir /recipes
|
|
WORKDIR /recipes
|
|
|
|
EXPOSE 8080
|
|
|
|
CMD ["/usr/local/bin/roux-server", "--host", "0.0.0.0", "--port", "8080", "--recipe-dir", "/recipes"]
|