From 1692b9f360dc694d10526f4b632e1c1ea2a62745 Mon Sep 17 00:00:00 2001 From: Daniel Bedeleanu Date: Sun, 19 Apr 2026 07:46:12 +0300 Subject: [PATCH] feat: add docker-compose configuration for e2e testing --- frontend/e2e/docker-compose.e2e.yml | 72 +++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 frontend/e2e/docker-compose.e2e.yml diff --git a/frontend/e2e/docker-compose.e2e.yml b/frontend/e2e/docker-compose.e2e.yml new file mode 100644 index 00000000..42aaa341 --- /dev/null +++ b/frontend/e2e/docker-compose.e2e.yml @@ -0,0 +1,72 @@ +version: '3.8' + +services: + backend: + build: + context: ../../backend + dockerfile: Dockerfile + ports: + - "${BACKEND_PORT}:8906" + environment: + DATABASE_URL: "sqlite:////tmp/test-${WORKFLOW_ID}.db" + LDAP_ENABLED: "${LDAP_ENABLED}" + LDAP_SERVER: "${LDAP_SERVER}" + LDAP_BASE_DN: "${LDAP_BASE_DN}" + AI_PROVIDER: "${AI_PROVIDER}" + GEMINI_API_KEY: "test-key-${WORKFLOW_ID}" + CLAUDE_API_KEY: "test-key-${WORKFLOW_ID}" + LOG_LEVEL: "INFO" + depends_on: + - ldap + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8906/health"] + interval: 2s + timeout: 5s + retries: 10 + start_period: 5s + networks: + - e2e-network + + frontend: + image: node:20-alpine + working_dir: /app + volumes: + - ../../frontend:/app + ports: + - "${FRONTEND_PORT}:3000" + environment: + NEXT_PUBLIC_API_URL: "http://localhost:${BACKEND_PORT}" + NEXT_PUBLIC_API_BASE_PATH: "" + command: > + sh -c "npm install --legacy-peer-deps && npm run dev" + healthcheck: + test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000"] + interval: 2s + timeout: 5s + retries: 10 + start_period: 10s + networks: + - e2e-network + + ldap: + image: osixia/openldap:1.5.0 + ports: + - "${LDAP_PORT}:389" + environment: + LDAP_ORGANISATION: "aInventory Test" + LDAP_DOMAIN: "ainventory.local" + LDAP_BASE_DN: "dc=ainventory,dc=local" + LDAP_ADMIN_PASSWORD: "admin" + LDAP_CONFIG_PASSWORD: "config" + healthcheck: + test: ["CMD", "ldapwhoami", "-H", "ldap://localhost:389", "-D", "cn=admin,dc=ainventory,dc=local", "-w", "admin"] + interval: 2s + timeout: 5s + retries: 10 + start_period: 5s + networks: + - e2e-network + +networks: + e2e-network: + driver: bridge