diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b098b723d9be9f7505a94288f898064b667dd881..86d450dbd6736b01fbdea349af21ccbfcd68ad2b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,7 +2,7 @@ image: docker:20.10.12
 
 variables:
   DOCKER_TLS_CERTDIR: "/certs"
-  BUILD_VERSION: 1
+  BUILD_VERSION: 2
 
 services:
   - docker:20.10.12-dind
diff --git a/Dockerfile b/Dockerfile
index 571654760cdade75b060b6d494cc1ef0c6a65bca..ba12fba588833fced674f4f2a0bd75923cd73907 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,8 +3,12 @@ LABEL maintainer="andrej.ramaseuski@pirati.cz"
 ARG VERSION=2.0.4
 ARG REPO=https://github.com/mettle/sendportal.git
 
+# Install composer
+COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
+
 # Install requirements
 RUN apt-get update && apt-get -y --no-install-recommends install \
+    ssl-cert \
     libsodium-dev \
     libsodium23 \
     libzip-dev \
@@ -18,20 +22,16 @@ RUN apt-get update && apt-get -y --no-install-recommends install \
 # Install PHP plugins
 RUN docker-php-ext-install pcntl sodium zip pgsql pdo pdo_pgsql
 
-# Install composer
-COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
-
 # Download and unpack sendportal
-# RUN curl -sL "${APP}" | tar -xzC /var/www/html
-RUN cd /var/www/html && git clone --depth 1 ${REPO}
-
-# Install SendPortal and its dependencies
-RUN cd /var/www/html/sendportal && \
+RUN cd /var/www/html && \
+    git clone --depth 1 ${REPO} && \
+    cd sendportal && \
+    chown -R www-data storage && \
     composer install
 
-RUN chown -R www-data /var/www/html/sendportal/storage && \
-    a2enmod rewrite && \
-    sed -i "s#www/html#www/html/sendportal/public#" /etc/apache2/sites-available/000-default.conf
+RUN a2enmod rewrite ssl && \
+    a2ensite default-ssl && \
+    sed -i "s#www/html#www/html/sendportal/public#" /etc/apache2/sites-available/default-ssl.conf
 
 COPY entrypoint.sh entrypoint.sh