feat: add docker-compose configuration for e2e testing

This commit is contained in:
2026-04-19 07:46:12 +03:00
parent 146c23631d
commit 1692b9f360

View File

@@ -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