docker-compose.yml 738 B

123456789101112131415161718192021222324252627
  1. services:
  2. app:
  3. build:
  4. context: .
  5. dockerfile: Dockerfile
  6. container_name: serial-mqtt-gateway
  7. network_mode: "host"
  8. environment:
  9. - FLASK_APP=app.py
  10. - FLASK_ENV=production
  11. - PYTHONDONTWRITEBYTECODE=1
  12. - PYTHONUNBUFFERED=1
  13. # 如果需要在容器中访问串口设备,请取消下面的注释并根据实际情况修改
  14. # devices:
  15. # - /dev/ttyUSB0:/dev/ttyUSB0
  16. # - /dev/ttyACM0:/dev/ttyACM0
  17. restart: unless-stopped
  18. # volumes:
  19. # # 可选:用于调试的日志卷
  20. # - ./logs:/app/backend/logs
  21. # 如果需要连接到MQTT代理,可以添加网络配置
  22. # networks:
  23. # - mqtt-network
  24. # networks:
  25. # mqtt-network:
  26. # external: true