version: '3.8'

services:
  # PostgreSQL Database
  postgres:
    image: postgres:15-alpine
    container_name: mockupaws-postgres
    restart: unless-stopped
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: mockupaws
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 5s
      timeout: 5s
      retries: 5
    networks:
      - mockupaws-network

  # Backend API (Opzionale - per produzione)
  # Per sviluppo, usa: uv run uvicorn src.main:app --reload
  # backend:
  #   build:
  #     context: .
  #     dockerfile: Dockerfile.backend
  #   container_name: mockupaws-backend
  #   restart: unless-stopped
  #   environment:
  #     DATABASE_URL: postgresql+asyncpg://postgres:postgres@postgres:5432/mockupaws
  #     API_V1_STR: /api/v1
  #     PROJECT_NAME: mockupAWS
  #   ports:
  #     - "8000:8000"
  #   depends_on:
  #     postgres:
  #       condition: service_healthy
  #   volumes:
  #     - ./src:/app/src
  #   networks:
  #     - mockupaws-network

  # Frontend React (Opzionale - per produzione)
  # Per sviluppo, usa: cd frontend && npm run dev
  # frontend:
  #   build:
  #     context: ./frontend
  #     dockerfile: Dockerfile.frontend
  #   container_name: mockupaws-frontend
  #   restart: unless-stopped
  #   environment:
  #     VITE_API_URL: http://localhost:8000
  #   ports:
  #     - "3000:80"
  #   depends_on:
  #     - backend
  #   networks:
  #     - mockupaws-network

volumes:
  postgres_data:
    driver: local

networks:
  mockupaws-network:
    driver: bridge
