Skip to content

Commit b739204

Browse files
authored
Merge pull request #269 from japtain-cack/nsnow/devices
fix(compose-ng): Adding ability to set devices
2 parents 60ec41f + 2b04ee7 commit b739204

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

docker/compose/ng.sls

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,17 @@ include:
126126
- restart_policy: {{ policy[0] }}:{{ policy[-1] }}
127127
{%- endif %}
128128
{%- endif %}
129+
{%- if 'devices' in container %}
130+
- devices:
131+
{%- for device in container.devices %}
132+
{%- set mapping = device.rsplit(':', 1) %}
133+
{%- if mapping|length > 1 %}
134+
- "{{ mapping[0] }}:{{ mapping[-1] }}"
135+
{%- else %}
136+
- "{{ mapping[0] }}"
137+
{%- endif %}
138+
{%- endfor %}
139+
{%- endif %}
129140
- require:
130141
- docker_image: {{ formula }}-compose-ng-{{ id }}-present
131142
{%- if required_containers is defined %}

pillar.example

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,23 @@ docker:
149149
delay: 5s
150150
max_attempts: 3
151151
window: 120s
152+
mycroft01:
153+
image: "mycroftai/docker-mycroft"
154+
container_name: "mycroft01"
155+
ports:
156+
- "8181:8181/tcp"
157+
- "8181:8181/udp"
158+
environment:
159+
"PULSE_SERVER": "unix:${XDG_RUNTIME_DIR}/pulse/native"
160+
volumes:
161+
- "/opt/mycroft/mycroft01:/root/.mycroft"
162+
- "/run/user/1001/pulse/native:/run/user/1001/pulse/native"
163+
- "/var/run/pulse/.config/pulse/cookie:/root/.config/pulse/cookie"
164+
devices:
165+
- "/dev/snd"
166+
restart: "always"
167+
tty: true
168+
stdin_open: true
152169

153170
swarm:
154171
# Per https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.swarm.html

0 commit comments

Comments
 (0)