From 18904f77deb54141c1dc44acb7fcb60fed79f971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20O=C5=BEana?= Date: Tue, 19 Mar 2024 15:45:06 +0100 Subject: [PATCH] Add target minicrawler-with-php for testing --- .docker/minicrawler/Dockerfile | 70 ++++++++++++++++++---------------- compose.yml | 10 ++++- 2 files changed, 46 insertions(+), 34 deletions(-) diff --git a/.docker/minicrawler/Dockerfile b/.docker/minicrawler/Dockerfile index c137474..cde6cc7 100644 --- a/.docker/minicrawler/Dockerfile +++ b/.docker/minicrawler/Dockerfile @@ -1,39 +1,39 @@ FROM debian:bookworm-slim as minicrawler -ENV DEBIAN_FRONTEND=noninteractive +ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get -y install \ - # minicrawler dev deps - libc-ares-dev \ - zlib1g-dev \ - libicu-dev \ - libssl-dev \ - libnghttp2-dev \ - \ - # build tool - make \ - autoconf \ - automake \ - autotools-dev \ - build-essential \ - libtool \ - gcc \ - \ - # tools - curl \ - ca-certificates \ - apt-transport-https \ - locales \ - tzdata \ - \ - && sed -i 's/^.*\(en_US.UTF-8\)/\1/' /etc/locale.gen \ - && locale-gen \ - && ln -sf "/usr/share/zoneinfo/Europe/Prague" /etc/localtime && dpkg-reconfigure tzdata \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/* \ - # update certificates \ - && mkdir -p /var/lib/certs \ - && curl -s -f -L https://curl.se/ca/cacert.pem -o ca-bundle.crt \ - && cat /etc/ssl/certs/ca-certificates.crt >> ca-bundle.crt \ + # minicrawler dev deps + libc-ares-dev \ + zlib1g-dev \ + libicu-dev \ + libssl-dev \ + libnghttp2-dev \ + \ + # build tool + make \ + autoconf \ + automake \ + autotools-dev \ + build-essential \ + libtool \ + gcc \ + \ + # tools + curl \ + ca-certificates \ + apt-transport-https \ + locales \ + tzdata \ + \ + && sed -i 's/^.*\(en_US.UTF-8\)/\1/' /etc/locale.gen \ + && locale-gen \ + && ln -sf "/usr/share/zoneinfo/Europe/Prague" /etc/localtime && dpkg-reconfigure tzdata \ + && rm -rf /var/lib/apt/lists/* /var/cache/apt/* \ + # update certificates \ + && mkdir -p /var/lib/certs \ + && curl -s -f -L https://curl.se/ca/cacert.pem -o ca-bundle.crt \ + && cat /etc/ssl/certs/ca-certificates.crt >> ca-bundle.crt \ && cp -v ca-bundle.crt /var/lib/certs/ca-bundle.crt ENV LC_ALL en_US.UTF-8 @@ -46,3 +46,9 @@ RUN ./autogen.sh \ && ./configure --prefix=/var/lib/minicrawler/usr --with-ca-bundle=/var/lib/certs/ca-bundle.crt --with-ca-path=/etc/ssl/certs \ && make || exit 42 \ && make install || exit 43 + +FROM minicrawler as minicrawler-with-php + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update && apt-get -y install php \ No newline at end of file diff --git a/compose.yml b/compose.yml index 2889ae0..4bcda48 100644 --- a/compose.yml +++ b/compose.yml @@ -1,18 +1,24 @@ +name: minicrawler version: "3.9" # docker compose pull httpbin # docker compose up -d httpbin services: + httpbin: image: kennethreitz/httpbin ports: - "80:80" + # docker compose build minicrawler - # docker compose run minicrawler + # docker compose run --rm minicrawler minicrawler: tty: true - build: .docker/minicrawler + build: + context: . + dockerfile: .docker/minicrawler/Dockerfile + target: minicrawler-with-php environment: - ENVNAME=dev - HTTPBIN_URL=http://httpbin:80