Skip to content

Commit

Permalink
Add target minicrawler-with-php for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
OzzyCzech committed Mar 19, 2024
1 parent 69cd419 commit 18904f7
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 34 deletions.
70 changes: 38 additions & 32 deletions .docker/minicrawler/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
10 changes: 8 additions & 2 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 18904f7

Please sign in to comment.