diff --git a/docker/compose/ng.sls b/docker/compose/ng.sls index 828b1464..6bc7506e 100644 --- a/docker/compose/ng.sls +++ b/docker/compose/ng.sls @@ -126,6 +126,17 @@ include: - restart_policy: {{ policy[0] }}:{{ policy[-1] }} {%- endif %} {%- endif %} + {%- if 'devices' in container %} + - devices: + {%- for device in container.devices %} + {%- set mapping = device.rsplit(':', 1) %} + {%- if mapping|length > 1 %} + - "{{ mapping[0] }}:{{ mapping[-1] }}" + {%- else %} + - "{{ mapping[0] }}" + {%- endif %} + {%- endfor %} + {%- endif %} - require: - docker_image: {{ formula }}-compose-ng-{{ id }}-present {%- if required_containers is defined %} diff --git a/pillar.example b/pillar.example index f13270b3..331a8484 100644 --- a/pillar.example +++ b/pillar.example @@ -149,6 +149,23 @@ docker: delay: 5s max_attempts: 3 window: 120s + mycroft01: + image: "mycroftai/docker-mycroft" + container_name: "mycroft01" + ports: + - "8181:8181/tcp" + - "8181:8181/udp" + environment: + "PULSE_SERVER": "unix:${XDG_RUNTIME_DIR}/pulse/native" + volumes: + - "/opt/mycroft/mycroft01:/root/.mycroft" + - "/run/user/1001/pulse/native:/run/user/1001/pulse/native" + - "/var/run/pulse/.config/pulse/cookie:/root/.config/pulse/cookie" + devices: + - "/dev/snd" + restart: "always" + tty: true + stdin_open: true swarm: # Per https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.swarm.html