Skip to content

Commit

Permalink
Bump to debian:sid-20201012 and ES 7.12.0; add PyPy
Browse files Browse the repository at this point in the history
Fast-forward to debian:sid-20201012-slim, which is the last snapshot
before Python 3.9 became the default in Debian

Install PyPy (pypy3 7.3.2) for speed improvement; see OpenDRR/opendrr-api#137

Refresh most Python libraries from Debian packages, and avoid building
psycopg2 from source:

 - python3-numpy: 1.19.2 (was 1.18.5)
 - python3-pandas: 1.0.5 (was 1.0.4)
 - python3-psycopg2: 2.8.5 (was 2.6)
 - python3-psycopg2cffi: 2.8.1 (newly added)
 - python3-requests: 2.23.0 (was 2.23.0)
 - python3-sqlalchemy: 1.3.19 (was 1.3.17)

From PyPI using pip3:

 - elasticsearch: 7.12.0 (was 7.7.1)

Install git 2.30.2 and git-lfs 2.13.2 from Debian 11 (bullseye)
as the old git-lfs 2.11.0 hangs at "GIT_LFS_SKIP_SMUDGE=1 git checkout".

Move installation of extra utilities needed by add_data.sh from
OpenDRR/opendrr-api python/Dockerfile to this repo:

 - dos2unix eatmydata jq moreutils nano time

Add org.opencontainers.image.* labels

Clean up /var/lib/apt/lists/* to further save space.

Image size has been reduced from 662MB to 561MB.
  • Loading branch information
anthonyfok committed Oct 22, 2021
1 parent fa59bc0 commit 879fcf9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
31 changes: 20 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,32 @@
#
# =================================================================

FROM debian:sid-20200720-slim

LABEL maintainer="Joost van Ulden <[email protected]>"
FROM debian:sid-20201012-slim

LABEL org.opencontainers.image.authors="Joost van Ulden <[email protected]>, Anthony Fok <[email protected]>"
LABEL org.opencontainers.image.source="https://github.com/opendrr/python-env"
LABEL org.opencontainers.image.version="1.1.0"
LABEL org.opencontainers.image.vendor="Government of Canada"
LABEL org.opencontainers.image.licenses="MIT"

# copy required files
COPY . .

RUN echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/docker-snapshot.conf && \
sed -i '/snapshot.debian.org/s/^# //; /deb.debian.org/s/^/# /; s/20200720/20200731/' /etc/apt/sources.list && \
apt-get update && apt-get dist-upgrade -y && \
apt-get install -y libpq-dev gcc curl git-lfs gdal-bin python3-pip && \
pip3 install psycopg2~=2.6 && \
apt-get autoremove -y gcc && \
apt-get install -y postgresql-client && \
sed -i '/snapshot.debian.org/s/^/# /; /deb.debian.org/s/^# //' /etc/apt/sources.list && \
pip3 install --upgrade pip && pip install -r requirements.txt
sed -i '/snapshot.debian.org/s/^# //; /deb.debian.org/s/^/# /' /etc/apt/sources.list && \
echo "deb http://deb.debian.org/debian bullseye main" >> /etc/apt/sources.list && \
echo 'Package: *\n\
Pin: release n=bullseye\n\
Pin-Priority: 50' > /etc/apt/preferences.d/git-in-bullseye && \
cat /etc/apt/preferences.d/git-in-bullseye && \
apt-get update && \
apt-get install -y --no-install-recommends \
curl gdal-bin postgresql-client \
dos2unix eatmydata jq moreutils nano time \
python3-numpy python3-pandas python3-psycopg2 python3-psycopg2cffi \
python3-requests python3-sqlalchemy pypy3 python3-pip && \
apt-get install -y --no-install-recommends -t bullseye git git-lfs && \
pip3 install elasticsearch==7.12.0 && \
rm -rf /var/lib/apt/lists/*

ENV PYTHONUNBUFFERED 1
12 changes: 0 additions & 12 deletions requirements.txt

This file was deleted.

0 comments on commit 879fcf9

Please sign in to comment.