# Lokal utvecklingsmiljö: Postgres + Redis.
# API/worker/admin körs med pnpm dev på värddatorn.
services:
  postgres:
    image: postgres:16-alpine
    container_name: app-postgres-dev
    environment:
      POSTGRES_DB: app
      POSTGRES_USER: app_user
      POSTGRES_PASSWORD: app_dev_password
    ports:
      - "5432:5432"
    volumes:
      - app_pg_dev:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U app_user -d app"]
      interval: 5s
      timeout: 3s
      retries: 10

  redis:
    image: redis:7-alpine
    container_name: app-redis-dev
    command: ["redis-server", "--maxmemory", "256mb", "--maxmemory-policy", "noeviction"]
    ports:
      - "6379:6379"
    volumes:
      - app_redis_dev:/data

volumes:
  app_pg_dev:
  app_redis_dev:
