version: '3.8' services: php: build: context: . dockerfile: Dockerfile volumes: - .:/var/www/html # 将当前目录挂载到容器 command: php think run # 启动 PHP 内置服务器 ports: - "8000:8000" # 映射容器端口到主机端口