diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 99ddb521312f4478dbb1fec5393f4d9e3c3ee41c..812bb995230bec0fa55b738201eae505524ef695 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,11 +1,6 @@
 variables:
   HEROKU_APP_NAME: tdt4242-base
   HEROKU_REGISTRY_IMAGE: registry.heroku.com/${HEROKU_APP_NAME}/web
-
-image: docker:stable
-services:
-  - docker:dind
-
 stages:
   - test
   - build_and_deploy
@@ -21,6 +16,9 @@ test:
     - python manage.py test
 
 build_and_deploy:
+  image: docker:stable
+  services:
+    - docker:dind
   stage: build_and_deploy
   script:
     - apk add --no-cache curl