diff --git a/Dockerfile b/Dockerfile
index 7f986cbcee3e5d36a9bdda4a1221c71838f8ba74..de12f5ad5b4d816a29e6a287ed4646e1df149c98 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,10 +1,18 @@
 FROM debian
-RUN apt-get update && apt-get install -y python-pip python-dev git wget vim
-RUN mkdir /src && cd /src && git clone https://github.com/pyinstaller/pyinstaller.git
-ADD . /src/agkyra
+RUN apt-get update && apt-get install -y python-pip python-dev git
 RUN apt-get install -y locales && echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && locale-gen
+RUN adduser --disabled-password --gecos "" user
 ENV LANG en_US.UTF-8
-RUN cd /src/agkyra && ./configure.sh linux64 && python setup.py install
-RUN adduser --disabled-password --gecos "" --ingroup root user
-RUN chmod -R g+w /src
-RUN su -c "cd /src/agkyra && ../pyinstaller/pyinstaller.py agkyra.spec" user
+
+WORKDIR /home/user
+ADD . /home/user/agkyra
+
+RUN git clone https://github.com/pyinstaller/pyinstaller.git
+WORKDIR /home/user/agkyra
+RUN python configure.py linux64 && python setup.py install
+RUN chown user:user /home/user/agkyra/build
+RUN chown user:user /home/user/agkyra/dist
+
+USER user
+ENV HOME /home/user
+RUN ../pyinstaller/pyinstaller.py agkyra.spec