Using serial port on docker

How can I configure serial communication, specifically with an Arduino device, within a Node-RED Docker container using the provided docker-compose.yml file?

this is my docker-compose.yml

version: "3"

services:
  node-red:
    image: nodered/node-red:latest
    environment:
      - TZ = Asia/Jakarta
      - NODE_RED_ADMIN_PW=${NODE_RED_PW_1}
    container_name: secure_noderedx
    ports:
      - "1880:1880"
      - "1883:1883"
    command:
      - "/settings/settings.js"
    volumes:
      - volume_server_1:/data
      - ./settings/settings.js:/data/settings.js
    devices:
      - /dev/ttyACM0
    env_file:
      - .env
  influxdb:
    container_name: influxdb
    image: influxdb:latest
    environment:
      - TZ = Asia/Jakarta
    volumes:
      - influxdb-lib:/var/lib/influxdb2
    env_file:
      # BE SURE TO CHANGE THIS LINE BEFORE GOING TO PRODUCTION
      - ./influx2.env
    ports:
      - 8086:8086
    restart: always
    privileged: true

  grafana:
    container_name: grafana
    image: grafana/grafana:latest
    volumes:
      # Note: The 'ro' option specifies that the volume is mounted in read-only mode.
      # However, certain files such as grafana.ini may require write access. Be mindful of security implications when removing ':ro'.
      # Docs : https://docs.docker.com/compose/compose-file/compose-file-v3/#short-syntax-3
      - grafana-lib:/var/lib/grafana
      - grafana-log:/var/log/grafana
    links:
      - influxdb:influxdb
    env_file:
      # BE SURE TO CHANGE THIS LINE BEFORE GOING TO PRODUCTION
      - ./grafana.env
    ports:
      - 3000:3000
    depends_on:
      - influxdb
    restart: always
    privileged: true

volumes:
  volume_server_1:
  influxdb-lib:
    external: false

  grafana-lib:
    external: false

  grafana-log:
    external: false

A docker question, not really a Node-RED one?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.