- 将前端API基础URL从绝对路径改为相对路径以支持反向代理 - 添加生产环境配置文件指定相对路径API接口 - 新增Dockerfile实现前后端一体化容器化部署 - 添加docker-compose示例配置用于本地开发环境测试 - 配置Nginx反向代理处理API和WebSocket请求
28 lines
698 B
YAML
28 lines
698 B
YAML
services:
|
|
android-automation:
|
|
image: android-automation-api:latest
|
|
container_name: android-automation-api
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "8000:80"
|
|
environment:
|
|
- APP_NAME=Android Automation API
|
|
- APP_VERSION=1.0.0
|
|
- DEBUG=false
|
|
- DEFAULT_DEVICE_SERIAL=
|
|
volumes:
|
|
- ./app:/app/app:ro
|
|
- ./scripts:/app/scripts:ro
|
|
devices:
|
|
- /dev/bus/usb:/dev/bus/usb
|
|
privileged: true
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 10s
|