| 123456789101112131415161718192021222324252627 |
- services:
- app:
- build:
- context: .
- dockerfile: Dockerfile
- container_name: serial-mqtt-gateway
- network_mode: "host"
- environment:
- - FLASK_APP=app.py
- - FLASK_ENV=production
- - PYTHONDONTWRITEBYTECODE=1
- - PYTHONUNBUFFERED=1
- # 如果需要在容器中访问串口设备,请取消下面的注释并根据实际情况修改
- # devices:
- # - /dev/ttyUSB0:/dev/ttyUSB0
- # - /dev/ttyACM0:/dev/ttyACM0
- restart: unless-stopped
- # volumes:
- # # 可选:用于调试的日志卷
- # - ./logs:/app/backend/logs
- # 如果需要连接到MQTT代理,可以添加网络配置
- # networks:
- # - mqtt-network
- # networks:
- # mqtt-network:
- # external: true
|