version: '3.8'

services:
  redis-dev:
    image: redis:7-alpine
    ports:
      - "6379:6379"
    volumes:
      - redis_dev_data:/data

  web-dev:
    platform: linux/arm64
    build:
      context: .
      dockerfile: Dockerfile.dev
    ports:
      - "5173:5173"
    volumes:
      - .:/app
      - /app/node_modules
      - ./public:/app/public
    environment:
      - NODE_ENV=development
      - VITE_API_URL=http://localhost:3000
    command: pnpm dev
    depends_on:
      - api-dev

  api-dev:
    platform: linux/arm64
    build:
      context: .
      dockerfile: Dockerfile.dev.api
    ports:
      - "804:804"
    volumes:
      - .:/app
      - /app/node_modules
    environment:
      - NODE_ENV=development
      - PORT=804
      - SMTP_HOST=${SMTP_HOST}
      - SMTP_PORT=${SMTP_PORT}
      - SMTP_SECURE=${SMTP_SECURE}
      - RECIPIENT_EMAIL=${RECIPIENT_EMAIL}
      - GOOGLE_EMAIL=${GOOGLE_EMAIL}
      - GOOGLE_APP_PASSWORD=${GOOGLE_APP_PASSWORD}
      - REDIS_URL=redis://redis-dev:6379
    command: pnpm dev
    depends_on:
      - redis-dev

volumes:
  redis_dev_data:
