name: branchforge

services:
  postgres:
    image: postgres:16-alpine
    environment:
      POSTGRES_USER: branchforge
      POSTGRES_PASSWORD: branchforge
      POSTGRES_DB: branchforge_test
    ports:
      - "127.0.0.1:55432:5432"
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U branchforge -d branchforge_test"]
      interval: 5s
      timeout: 5s
      retries: 20
    volumes:
      - postgres_data:/var/lib/postgresql/data

  redis:
    image: redis:7-alpine
    command: ["redis-server", "--save", "", "--appendonly", "no"]
    ports:
      - "127.0.0.1:56379:6379"
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 5s
      retries: 20

volumes:
  postgres_data:
