Skip to content

Commit

Permalink
Move Docker container to alpine and update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
cavenel committed Feb 17, 2023
1 parent 6b367ab commit 1e853ef
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
examples
plugins
plugins_repo
standalone
build
.git
40 changes: 35 additions & 5 deletions container/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,42 @@
FROM python:3.8

# Install libvips and openslide
RUN apt-get update && apt-get upgrade -y && apt-get install bash nano openslide-tools libvips -y
FROM python:3.10-alpine

COPY ./container/requirements.txt /requirements.txt
COPY ./container/tissuumaps.cfg /tissuumaps.cfg

RUN pip3 install -r /requirements.txt
# Install libvips

RUN apk update \
&& apk upgrade
RUN apk add vips hdf5 hdf5-dev

RUN pip3 install --upgrade pip setuptools wheel && \
apk add --no-cache --virtual .build-deps gfortran openblas-dev gcc g++ zlib-dev make python3-dev jpeg-dev && \
pip3 install -r /requirements.txt && \
apk del .build-deps

# Install openslide

WORKDIR /usr/local/src

ARG OPENSLIDE_VERSION=3.4.1
ARG OPENSLIDE_URL=https://github.com/openslide/openslide/releases/download

COPY container/openslide-init.patch /usr/local/src

RUN apk add --no-cache --virtual .build-deps2 build-base \
autoconf automake libtool bc zlib-dev libxml2-dev jpeg-dev \
openjpeg-dev tiff-dev glib-dev gdk-pixbuf-dev sqlite-dev libjpeg-turbo-dev \
libexif-dev lcms2-dev fftw-dev giflib-dev libpng-dev libwebp-dev orc-dev \
poppler-dev librsvg-dev libgsf-dev openexr-dev gtk-doc \
&& wget ${OPENSLIDE_URL}/v${OPENSLIDE_VERSION}/openslide-${OPENSLIDE_VERSION}.tar.gz \
&& tar xf openslide-${OPENSLIDE_VERSION}.tar.gz \
&& patch -p0 <openslide-init.patch \
&& cd openslide-${OPENSLIDE_VERSION} \
&& ./configure \
&& make \
&& make install \
&& apk del .build-deps2

RUN pip3 install gunicorn gevent

COPY ./tissuumaps/ /app/tissuumaps
Expand Down
13 changes: 13 additions & 0 deletions container/openslide-init.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff -Naur openslide-3.4.1-orig/src/openslide.c openslide-3.4.1/src/openslide.c
--- openslide-3.4.1-orig/src/openslide.c 2015-04-20 20:32:12.000000000 +0100
+++ openslide-3.4.1/src/openslide.c 2018-03-23 16:47:13.788824940 +0000
@@ -61,7 +61,9 @@
g_thread_init(NULL);
}
// initialize GObject
+#if !GLIB_CHECK_VERSION(2, 36, 0)
g_type_init();
+#endif
// init libxml2
xmlInitParser();
// parse debug options
10 changes: 5 additions & 5 deletions container/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Flask==2.0.0
openslide-python==1.1.2
scipy<1.9.0
Flask>=2.0.0
openslide-python>=1.1.2
Pillow>=8.2.0
pyvips==2.1.14
matplotlib==3.2.2
pyvips>=2.1.14
matplotlib>=3.2.2
pyyaml>=6.0
h5py>=3.6.0
scipy>=1.7.2

0 comments on commit 1e853ef

Please sign in to comment.