diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 00506d6eb7fa3e13dcf5b4c90d7798da3579a5f3..012485c6bdff7aa4907c10a6cae76697387571b5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -43,18 +43,18 @@ deploy:
   only:
     - main
   variables:
-    PORT: 8081  # Set the port to run the application on
-    ENVIRONMENT: test  # Set the environment to test
+    CI: "true"        # Mark this as a CI run
+    ENVIRONMENT: dev  # Use dev environment settings
+    PORT: 8081        # Set the port for the application
   script:
-    - echo "Updating repository..."
-    - git pull origin main  # Update the repository with the latest code
-    - echo "Setting up Python dependencies..."
+    - echo "Setting up dependencies..."
     - source $VIRTUAL_ENV/bin/activate
-    - pip install -r requirements.txt  # Install the required Python dependencies
-    - bash ./make_openapi_client.sh  # Re-generate OpenAPI client library
-    - echo "Running the application on port $PORT..."
+    - pip install -r requirements.txt
+    - echo "Verifying SSL files..."
+    - ls ssl/  # Ensure dev SSL certificates are present
+    - echo "Running the application with dev SSL certificates on port $PORT..."
     - cd backend
-    - python3.8 -m main  # The app will now use $PORT for binding
+    - python3.8 -m main
 
 release:
   stage: release
diff --git a/backend/main.py b/backend/main.py
index 7308901d7f0d786bc18460c35b315e1b3062aa39..23e9f47e5cc173757f921d8c65121a63c30f2be8 100644
--- a/backend/main.py
+++ b/backend/main.py
@@ -93,18 +93,28 @@ if __name__ == "__main__":
 
         # Get environment from an environment variable
         environment = os.getenv("ENVIRONMENT", "dev")
+        is_ci = os.getenv("CI", "false").lower() == "true"  # Check if running in CI
         port = int(os.getenv("PORT", 8000))  # Default to 8000 if PORT is not set
 
         # Paths for SSL certificates
-        cert_path = "ssl/cert.pem"
-        key_path = "ssl/key.pem"
-
-        if environment == "test":
+        if is_ci:
+            # Use self-signed certificates for CI
+            cert_path = "ssl/cert.pem"
+            key_path = "ssl/key.pem"
+            host = "127.0.0.1"  # In CI, bind to localhost
+            print("Using self-signed SSL certificates for CI...")
+        elif environment == "test":
+            # Use proper test certificates
             cert_path = "ssl/mx-aare-test.psi.ch.pem"
             key_path = "ssl/mx-aare-test.psi.ch.key"
-            host = "0.0.0.0"  # Bind to all interfaces
+            host = "0.0.0.0"  # In test, bind to all interfaces
+            print("Using test SSL certificates...")
         else:
-            host = "127.0.0.1"  # Default for other environments
+            # Use development self-signed certificates
+            cert_path = "ssl/cert.pem"
+            key_path = "ssl/key.pem"
+            host = "127.0.0.1"  # Bind to localhost for dev
+            print("Using self-signed SSL certificates for development...")
 
         # Run the application with appropriate SSL setup
         uvicorn.run(