version: "3.8"

services:
  # Production service
  app:
    platform: ${DOCKER_PLATFORM:-linux/amd64}
    build:
      context: .
      dockerfile: Dockerfile
      args:
        TENANT: ${TENANT:-tis}
        DIST_DIR: ${DIST_DIR:-tis}
    container_name: psp_panel_prod
    ports:
      - "5000:5000"
    environment:
      - NODE_ENV=production
    restart: unless-stopped
    healthcheck:
      test: [ "CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:5000/" ]
      interval: 30s
      timeout: 3s
      retries: 3
      start_period: 5s
    networks:
      - psp_panel_network
  # Staging service
  # staging:
  #   build:
  #     context: .
  #     dockerfile: Dockerfile.staging
  #   container_name: psp_panel_staging
  #   ports:
  #     - "5050:5000"
  #   environment:
  #     - NODE_ENV=staging
  #   restart: unless-stopped
  #   healthcheck:
  #     test:
  #       ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/"]
  #     interval: 30s
  #     timeout: 3s
  #     retries: 3
  #     start_period: 5s
  #   profiles:
  #     - staging
  #   networks:
  #     - psp_panel_network

  # # Development service with hot reload
  # dev:
  #   build:
  #     context: .
  #     dockerfile: Dockerfile.dev
  #   container_name: psp_panel-dev
  #   working_dir: /app
  #   volumes:
  #     - .:/app
  #     - /app/node_modules
  #   ports:
  #     - "4200:4200"
  #   environment:
  #     - NODE_ENV=development
  #   restart: unless-stopped
  #   profiles:
  #     - dev
  #   networks:
  #     - psp_panel_network

networks:
  psp_panel_network:
    driver: bridge
