+# Gevent needs gcc, make, file, ffi
+RUN apk update && apk add gcc musl-dev make file libffi-dev
+# create a non-root user. Only really needed in stage 2,
+# however this makes the copying easier and straighttforward;
+# pip option --user doesn't do the same thing if run as root
+RUN addgroup -S a1user && adduser -S -G a1user a1user
+# switch to the non-root user for installing site packages
+USER a1user
+# Speed hack; we install gevent before a1 because when building repeatedly (eg during dev)
+# and only changing a1 code, we do not need to keep compiling gevent which takes forever
+RUN pip install --user gevent
+COPY setup.py /home/a1user/
+COPY a1/ /home/a1user/a1
+RUN pip install --user /home/a1user