version: '3.8'
services:
  # --- Frontend DEV ---
  dev-front:
    image: nginx:alpine
    ports:
      - "8081:80"
    volumes:
      - ./dev/PulsoCar/dist:/usr/share/nginx/html
      - ./nginx-frontend.conf:/etc/nginx/conf.d/default.conf:ro
    networks:
      - car-network

  # --- Frontend QA ---
  qa-front:
    image: nginx:alpine
    ports:
      - "8082:80"
    volumes:
      - ./qa/PulsoCar/dist:/usr/share/nginx/html
      - ./nginx-frontend.conf:/etc/nginx/conf.d/default.conf:ro
    networks:
      - car-network

  # --- Frontend PRE ---
  pre-front:
    image: nginx:alpine
    ports:
      - "8083:80"
    volumes:
      - ./pre/PulsoCar/dist:/usr/share/nginx/html
      - ./nginx-frontend.conf:/etc/nginx/conf.d/default.conf:ro
    networks:
      - car-network

  # --- Backend PHP ---
  dev-back:
    build:
      context: ./dev/backend-pulsocar
      dockerfile: Dockerfile
    volumes:
      - ./dev/backend-pulsocar:/var/www/html
    networks:
      - car-network

  dev-back-nginx:
    image: nginx:alpine
    ports:
      - "9000:80"
    volumes:
      - ./dev/backend-pulsocar:/var/www/html
      - ./nginx-backend.conf:/etc/nginx/conf.d/default.conf:ro
    networks:
      - car-network
    depends_on:
      - dev-back

networks:
  car-network:
    driver: bridge