services:
  dev:
    image: dev/lts
    container_name: itri_edge_impulse
    ports:
      - "8122:80"
    environment:
      - DB_HOST=mysql
    volumes:
      - .:/var/www/html
      
      # Apache HTTP 設定
      - ./docker/apache-data/000-default.conf:/etc/apache2/sites-enabled/000-default.conf:ro
      
      # ========== Apache HTTPS 設定 ==========
      - ./docker/apache-data/default-ssl.conf:/etc/apache2/sites-enabled/default-ssl.conf:ro
      
      # ========== SSL 憑證掛載 ==========
      - ~/docker-dev/dev-ssl/dev.crt:/etc/ssl/certs/dev.crt
      - ~/docker-dev/dev-ssl/dev.key:/etc/ssl/private/dev.key
      
      # PHP 設定
      - ./docker/conf/php.ini:/etc/php/8.3/fpm/php.ini:ro
      - ./docker/conf/php.ini:/etc/php/8.3/cli/php.ini:ro

      # ========== Supervisor 設定 ==========
      - ./docker/supervisor/workers.conf:/etc/supervisor/conf.d/workers.conf:ro

    stdin_open: true
    tty: true
    networks:
      - dev

networks:
  dev:
    external: true