# =============================================
# website-tuvi — Local development environment
# =============================================
# Run: docker compose up -d
# Stop: docker compose down
# Reset: docker compose down -v

services:
  postgres:
    image: postgres:16-alpine
    container_name: tuvi-postgres-dev
    restart: unless-stopped
    environment:
      POSTGRES_USER: tuvi
      POSTGRES_PASSWORD: tuvi_dev
      POSTGRES_DB: tuvi
      POSTGRES_INITDB_ARGS: "--encoding=UTF-8"
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U tuvi"]
      interval: 10s
      timeout: 5s
      retries: 5

  redis:
    image: redis:7-alpine
    container_name: tuvi-redis-dev
    restart: unless-stopped
    command: redis-server --requirepass tuvi_redis_dev --maxmemory 128mb
    ports:
      - "6379:6379"
    volumes:
      - redis_data:/data
    healthcheck:
      test: ["CMD", "redis-cli", "-a", "tuvi_redis_dev", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5

volumes:
  postgres_data:
  redis_data:
