diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a398635be4d9cc5de3704ca339e9798c1b89480f..57a8301f3792e5e3317b3dbd1af1bd5e592f8020 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -36,6 +36,9 @@ run-tests:
   services:
     - name: docker:${DOCKER_VERSION}-dind
       alias: localhost
+  variables:
+    MONGODB_URL_TEST: mongodb://localhost:27017/todo-app
+    JWT_SECRET_TEST: my-very-secret-jwt
   script:
     - docker run -p 27017:27017
       --detach
@@ -46,9 +49,8 @@ run-tests:
     - docker build
       --tag "${CONTAINER_TAG}-test"
       --network=host
-      --build-arg MONGODB_URL_TEST=mongodb://localhost:27017/todo-app
-      --build-arg JWT_SECRET_TEST=my-very-secret-jwt
-      --add-host=host.docker.internal:host-gateway
+      --build-arg MONGODB_URL_TEST=$MONGODB_URL_TEST
+      --build-arg JWT_SECRET_TEST=$JWT_SECRET_TEST
       --file "./app/Dockerfile.test"
       "./app"
   after_script: