File size: 1,138 Bytes
62787e2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | FROM python:3.8-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential python3-dev pkg-config curl xz-utils ca-certificates \
wkhtmltopdf \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# build exact libs
RUN curl -LO https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.9.tar.xz \
&& tar -xf libxml2-2.11.9.tar.xz && cd libxml2-2.11.9 \
&& ./configure --prefix=/opt/xml && make -j && make install && cd .. \
&& rm -rf libxml2-2.11.9 libxml2-2.11.9.tar.xz \
&& curl -LO https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.39.tar.xz \
&& tar -xf libxslt-1.1.39.tar.xz && cd libxslt-1.1.39 \
&& PKG_CONFIG_PATH=/opt/xml/lib/pkgconfig ./configure --prefix=/opt/xml \
&& make -j && make install && cd .. \
&& rm -rf libxslt-1.1.39 libxslt-1.1.39.tar.xz
ENV CFLAGS="-I/opt/xml/include" \
LDFLAGS="-L/opt/xml/lib" \
PKG_CONFIG_PATH="/opt/xml/lib/pkgconfig" \
LD_LIBRARY_PATH="/opt/xml/lib"
COPY requirements.txt .
RUN pip install -U pip setuptools wheel \
&& pip install --no-binary lxml -r requirements.txt
RUN playwright install --with-deps chromium
COPY . .
|