diff --git a/docker/Dockerfile b/docker/Dockerfile
index f6da05f4efdb594e0ef95176728b3c033027e985..b9f0acccc33e19b0eccb4d59740f7fa7f45bf2aa 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -1,5 +1,7 @@
 FROM docker.io/python:2-alpine3.8
 
+COPY . /synapse
+
 RUN apk add --no-cache --virtual .nacl_deps \
         build-base \
         libffi-dev \
@@ -9,12 +11,10 @@ RUN apk add --no-cache --virtual .nacl_deps \
         linux-headers \
         postgresql-dev \
         su-exec \
-        zlib-dev
-
-COPY . /synapse
-
+        zlib-dev \
+   
 # A wheel cache may be provided in ./cache for faster build
-RUN cd /synapse \
+ && cd /synapse \
  && pip install --upgrade \
         lxml \
         pip \