Switch twlight base to python:3.7-slim-buster
-FROM quay.io/wikipedialibrary/debian:buster-slim as twlight_base
+FROM quay.io/wikipedialibrary/python:3.7-slim-buster as twlight_base
# Base dependencies.
RUN apt update ; \
- apt install -y \
- libjpeg62-turbo \
- libxslt1-dev \
- libmariadb-dev \
- python3 \
- python3-pip ; \
+ apt install -y --no-install-recommends \
+ libmariadbclient-dev ; \
+ ln -s /usr/bin/mariadb_config /usr/bin/mysql_config ; \
+ rm -rf /var/lib/apt/lists/*; \
pip3 install virtualenv
FROM twlight_base as twlight_build
@@ -14,15 +12,11 @@ FROM twlight_base as twlight_build
COPY requirements /requirements
# Build dependencies.
-RUN apt install -y \
- build-essential \
+RUN apt update ; \
+ apt install -y --no-install-recommends \
gcc \
- libffi-dev \
- libjpeg62-turbo-dev \
- libxml2-dev \
- musl-dev \
- python3-dev \
- zlib1g-dev ; \
+ python3-dev ; \
+ rm -rf /var/lib/apt/lists/*; \
virtualenv /venv ; \
. /venv/bin/activate ; \
pip3 install -r /requirements/wmf.txt
@@ -30,7 +24,7 @@ RUN apt install -y \
FROM twlight_base
COPY --from=twlight_build /venv /venv
COPY --from=quay.io/wikipedialibrary/debian_perl:latest /opt/perl /opt/perl
-ENV PATH="/opt/perl/bin:${PATH}" TWLIGHT_HOME=/app PYTHONUNBUFFERED=1 PYTHONPATH="/app:/venv:/usr/lib/python3.8"
+ENV PATH="/opt/perl/bin:${PATH}" TWLIGHT_HOME=/app PYTHONUNBUFFERED=1 PYTHONPATH="/app:/venv"
# Runtime dependencies.
# Refactoring shell code could remove bash dependency
@@ -41,7 +35,8 @@ ENV PATH="/opt/perl/bin:${PATH}" TWLIGHT_HOME=/app PYTHONUNBUFFERED=1 PYTHONPATH
# CSS Janus is the thing actually used to generate the rtl css.
# Pandoc is used for rendering wikicode resource descriptions
# into html for display. We do need this on the live image.
-RUN apt install -y \
+RUN apt update ; \
+ apt install -y --no-install-recommends \
bash \
gettext \
git \
@@ -51,8 +46,8 @@ RUN apt install -y \
pandoc \
tar \
wget ; \
- apt clean ; \
- npm install cssjanus
+ rm -rf /var/lib/apt/lists/*; \
+ /usr/bin/npm install cssjanus
# Utility scripts that run in the virtual environment.
COPY bin /app/bin/
