version: '3.8'

services:
  hebrew-soldier-app:
    build: .
    ports:
      - "3000:3000"
    volumes:
      - ./config.json:/app/config.json:ro
    environment:
      - NODE_ENV=production
      - HOSTNAME=${HOSTNAME:-docker-container}
      - NEXT_PUBLIC_HOSTNAME=${HOSTNAME:-docker-container}
    restart: unless-stopped
    depends_on:
      - mysql
    networks:
      - app-network

  # Optional: Include MySQL if you want to run it in Docker too
  mysql:
    image: mysql:8.0
    environment:
      MYSQL_ROOT_PASSWORD: your_root_password
      MYSQL_DATABASE: emergency_tracker
      MYSQL_USER: soldier_tracker
      MYSQL_PASSWORD: your_secure_password_here
    ports:
      - "3306:3306"
    volumes:
      - mysql_data:/var/lib/mysql
      - ./scripts:/docker-entrypoint-initdb.d:ro
    restart: unless-stopped
    networks:
      - app-network

volumes:
  mysql_data:

networks:
  app-network:
    driver: bridge
