diff --git a/.docker/Dockerfile b/.docker/Dockerfile
index 1cb0b1bac27f66a630144bcac9119cd4a6312917..4da5a53aa17cc307e55f31c60cc2eb9d8e6e41e1 100644
--- a/.docker/Dockerfile
+++ b/.docker/Dockerfile
@@ -11,12 +11,12 @@ RUN apt-get update && \
 ARG PYLIB
 RUN echo "PYLIB=${PYLIB}"
 COPY .docker/wait-for-it.sh /wait-for-it.sh
-RUN pip install -r ./requirements.txt
+COPY . /git
+RUN pip install -r /git/requirements.txt
 ADD https://gitlab.indiscale.com/api/v4/projects/97/repository/commits/${PYLIB} \
     pylib_version.json
 RUN git clone https://gitlab.indiscale.com/caosdb/src/caosdb-pylib.git && \
     cd caosdb-pylib && git checkout ${PYLIB} && pip3 install .
-COPY . /git
 
 # Delete .git because it is huge.
 RUN rm -r /git/.git