services:
  dev:
    image: dev/nou-smf
    container_name: nou_smf
    ports:
      - "8064:80"
      - "8063:443"
    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 憑證掛載 ==========
      # 使用支援 IP 位址 (192.168.1.139) 的自簽憑證
      - ~/dev-ssl-ip/dev.crt:/etc/ssl/certs/dev.crt
      - ~/dev-ssl-ip/dev.key:/etc/ssl/private/dev.key
      
      # PHP 設定（與 image dev/nou-8.3 對應，使用 8.3 路徑）
      - ./docker/conf/php.ini:/etc/php/8.3/fpm/php.ini:ro
      - ./docker/conf/php.ini:/etc/php/8.3/cli/php.ini:ro

    stdin_open: true
    tty: true
    networks:
      - dev

networks:
  dev:
    external: true
