diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6a0b4f63c508d92a604763e8e3bc9f62c5948bba..670e57a94c99e034d3f97a0017c994b53951c667 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -46,7 +46,7 @@ build_docker_from_cache:
 test_serial:
   stage: test
   script:
-    - pytest-3 -q --cov=nifty8 test
+    - pytest -q --cov=nifty8 test
     - >
       python3 -m coverage report --omit "*plot*" | tee coverage.txt
     - >
@@ -57,7 +57,7 @@ test_mpi:
   variables:
     OMPI_MCA_btl_vader_single_copy_mechanism: none
   script:
-    - mpiexec -n 2 --bind-to none pytest-3 -q test/test_mpi
+    - mpiexec -n 2 --bind-to none pytest -q test/test_mpi
 
 pages:
   stage: release
diff --git a/Dockerfile b/Dockerfile
index 71aa4bee8da69e397a219118c3cb3f5459526249..41d6389b6ef9457b90833bf2d952aa1f0bf34338 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,17 +3,20 @@ FROM debian:stable-slim
 RUN apt-get update && apt-get install -y \
     # Needed for setup
     git python3-pip \
-    # Packages needed for NIFTy
-    python3-scipy \
     # Documentation build dependencies
     dvipng texlive-latex-base texlive-latex-extra \
+    # Dependency of mpi4py
+    libopenmpi-dev \
+    && rm -rf /var/lib/apt/lists/*
+RUN DUCC0_OPTIMIZATION=portable pip3 install \
+    # Packages needed for NIFTy
+    scipy \
+    # Optional nifty dependencies
+    matplotlib h5py astropy ducc0 jax jaxlib mpi4py \
     # Testing dependencies
-    python3-pytest-cov \
-    # Optional NIFTy dependencies
-    python3-mpi4py python3-matplotlib python3-h5py \
-  # more optional NIFTy dependencies
-  && DUCC0_OPTIMIZATION=portable pip3 install astropy ducc0 jupyter nbconvert jax jaxlib sphinx pydata-sphinx-theme jupytext \
-  && rm -rf /var/lib/apt/lists/*
+    pytest pytest-cov \
+    # Documentation build dependencies
+    jupyter nbconvert jupytext sphinx pydata-sphinx-theme
 
 # Set matplotlib backend
 ENV MPLBACKEND agg