diff --git a/Dockerfile b/Dockerfile
index 43ca107546fe4a92dae9e0bcffbdbcb81894ca97..5e1467e75218b83d911a0b0661d992669ce28010 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -19,6 +19,7 @@ RUN apt-get update \
     libgdbm-dev \
     liblzma-dev \
     libncursesw5-dev \
+    libpcre3-dev \
     libpng-dev \
     libpq-dev \
     libreadline-dev \
@@ -33,6 +34,12 @@ RUN apt-get update \
   && apt-get clean \
   && rm -rf /var/lib/apt/lists/*
 
+# Compile uwsgi with graylog2 plugin
+RUN wget https://projects.unbit.it/downloads/uwsgi-2.0.17.1.tar.gz \
+  && tar xfz uwsgi-2.0.17.1.tar.gz \
+  && cd uwsgi-2.0.17.1 \
+  && UWSGI_EMBED_PLUGINS=graylog2 python uwsgiconfig.py --build
+
 COPY requirements.txt /requirements.txt
 RUN python -m venv /venv \
   && . /venv/bin/activate \
@@ -48,8 +55,9 @@ RUN groupadd -r -g 1000 csi \
   && useradd --no-log-init -r -g csi -u 1000 csi
 
 COPY --chown=csi:csi --from=builder /venv /venv
+COPY --chown=csi:csi --from=builder /uwsgi-2.0.17.1/uwsgi /venv/bin/uwsgi
 
-# Install libraries for psycopg2 and pillow
+# Install libraries for psycopg2, pillow and uwsgi
 # Shall be the same as the one linked to when compiling in builder image!
 RUN apt-get update \
   && apt-get install -yq --no-install-recommends \
@@ -57,6 +65,8 @@ RUN apt-get update \
     libpng16-16 \
     libtiff5 \
     libpq5 \
+    libpcre3 \
+    zlib1g \
   && apt-get clean \
   && rm -rf /var/lib/apt/lists/*
 
diff --git a/requirements-to-freeze.txt b/requirements-to-freeze.txt
index 336128f5b605057fb25f8060277e2c5d457d64ca..ab3c21d7ea15d2ec72bd47dce5a47a6d8b3643b4 100644
--- a/requirements-to-freeze.txt
+++ b/requirements-to-freeze.txt
@@ -18,7 +18,6 @@ pyjwt
 python-dateutil
 pyyaml
 qrcode
-uwsgi
 whitenoise
 ansible-tower-cli
 raven
diff --git a/requirements.txt b/requirements.txt
index c3ff3a87c1f2e5b6079a7cdb74f3e3ec821f36a1..ff9c28928eada26984daa505d87166303d2cf7f4 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -48,7 +48,6 @@ sqlalchemy-citext==1.3.post0
 SQLAlchemy-Continuum==1.3.6
 SQLAlchemy-Utils==0.33.3
 urllib3==1.23
-uWSGI==2.0.17.1
 Werkzeug==0.14.1
 whitenoise==3.3.1
 WTForms==2.1