version: '3.8' services: # DinD container for isolated Docker operations dind: image: docker:dind container_name: ci-cd-test-dind privileged: true restart: unless-stopped environment: DOCKER_TLS_CERTDIR: "" ports: - "2375:2375" volumes: - /var/lib/docker healthcheck: test: ["CMD", "docker", "version"] interval: 10s timeout: 5s retries: 5 networks: - ci-cd-test-network # PostgreSQL for testing postgres: image: postgres:15-alpine container_name: ci-cd-test-postgres restart: unless-stopped environment: POSTGRES_DB: sharenet_test POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 10s timeout: 5s retries: 5 networks: - ci-cd-test-network # Rust toolchain container for backend testing rust-toolchain: image: rust:1.75-slim container_name: ci-cd-test-rust restart: unless-stopped volumes: - ./backend:/workspace/backend - /var/run/docker.sock:/var/run/docker.sock working_dir: /workspace/backend depends_on: dind: condition: service_healthy postgres: condition: service_healthy networks: - ci-cd-test-network command: sleep infinity # Node.js toolchain container for frontend testing node-toolchain: image: node:20-slim container_name: ci-cd-test-node restart: unless-stopped volumes: - ./frontend:/workspace/frontend - /var/run/docker.sock:/var/run/docker.sock working_dir: /workspace/frontend depends_on: dind: condition: service_healthy networks: - ci-cd-test-network command: sleep infinity networks: ci-cd-test-network: driver: bridge