Ctrl K
ComunidadGuías…

docker-compose-test.yml

Rama develop · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
# The containers that compose the project
services:
  db:
    image: postgres:13
    restart: always
    container_name: integration-tests-prisma
    ports:
      - '5432:5432'
    environment:
      POSTGRES_USER: prisma
      POSTGRES_PASSWORD: prisma
      POSTGRES_DB: tests
    networks:
      - keyshade-test
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U prisma"]
      interval: 2s
      timeout: 5s
      retries: 15
      start_period: 10s

  redis:
    image: redis:6
    container_name: integration-tests-redis
    ports:
      - '6379:6379'
    networks:
      - keyshade-test
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 2s
      timeout: 3s
      retries: 15
      start_period: 5s

  # CI-only service for API Docker validation
  api-ci:
    image: keyshade/api:ci-${GITHUB_SHA:-latest}
    container_name: api-ci
    ports:
      - "4200:4200"
    environment:
      NODE_ENV: e2e
      DATABASE_URL: postgresql://prisma:prisma@db:5432/tests
      REDIS_URL: redis://redis:6379
      JWT_SECRET: ci-secret
      DOMAIN: localhost
      API_PORT: "4200"
    depends_on:
      db:
        condition: service_healthy
      redis:
        condition: service_healthy
    networks:
      - keyshade-test
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:4200/api/health"]
      interval: 2s
      timeout: 3s
      retries: 15
      start_period: 10s
    profiles:
      - ci-api

  # CI-only service for Platform Docker validation
  platform-ci:
    image: keyshade/platform:ci-${GITHUB_SHA:-latest}
    container_name: platform-ci
    ports:
      - "3025:3000"
    networks:
      - keyshade-test
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"]
      interval: 2s
      timeout: 3s
      retries: 15
      start_period: 10s
    profiles:
      - ci-platform

  # CI-only service for Web Docker validation
  web-ci:
    image: keyshade/web:ci-${GITHUB_SHA:-latest}
    container_name: web-ci
    ports:
      - "3000:3000"
    networks:
      - keyshade-test
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"]
      interval: 2s
      timeout: 3s
      retries: 15
      start_period: 10s
    profiles:
      - ci-web

networks:
  keyshade-test:
    driver: bridge