docker-compose.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. services:
  2. frontend:
  3. build:
  4. context: ./frontend
  5. dockerfile: Dockerfile
  6. image: ghcr.io/tuanchris/dune-weaver-frontend:main
  7. restart: always
  8. cap_add:
  9. - SYS_NICE # Enable real-time thread priority for smooth UART communication
  10. # ports:
  11. # - "8080:8080" # Map port 8080 of the container to 8080 of the host (access via http://localhost:8080)
  12. network_mode: "host" # Use host network for device access
  13. volumes:
  14. - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
  15. depends_on:
  16. - backend
  17. container_name: dune-weaver-frontend
  18. backend:
  19. build: .
  20. image: ghcr.io/tuanchris/dune-weaver:main
  21. restart: always
  22. # Pin motion-critical backend to cores 0-2 (Raspberry Pi 4/5 has cores 0-3)
  23. # This prevents CPU contention from touch app blocking I/O calls
  24. cpuset: "0,1,2"
  25. ports:
  26. - "8080:8080"
  27. # Environment variables for testing (uncomment to enable):
  28. # environment:
  29. # FORCE_UPDATE_AVAILABLE: "1" # Always show update available
  30. # FAKE_LATEST_VERSION: "99.0.0" # Fake a newer version
  31. volumes:
  32. # Mount entire app directory for persistence
  33. - .:/app
  34. # Mount Docker socket for container self-restart/update
  35. - /var/run/docker.sock:/var/run/docker.sock
  36. # Mount timezone file from host for scheduling features
  37. - /etc/timezone:/etc/host-timezone:ro
  38. # Mount systemd for host shutdown capability
  39. - /run/systemd/system:/run/systemd/system:ro
  40. - /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket:ro
  41. - /sys/fs/cgroup:/sys/fs/cgroup:ro
  42. # Mount GPIO for DW LEDs and Desert Compass (reed switch)
  43. - /sys:/sys
  44. # Mount /dev for serial port access (devices may not exist at start time)
  45. - /dev:/dev
  46. privileged: true
  47. container_name: dune-weaver-backend