fix: run as root in dockerfile so audio can work

This commit is contained in:
David Huggins-Daines
2023-12-28 16:15:29 -05:00
parent 0f1f7a40dd
commit acae2e1bf5
+2 -5
View File
@@ -1,5 +1,5 @@
FROM alpine:latest as runtime
RUN apk add --no-cache python3 py3-pip sox
RUN apk add --no-cache python3 py3-pip sox portaudio alsa-utils alsaconf
FROM runtime as build
RUN apk add --no-cache cmake ninja gcc musl-dev python3-dev pkgconfig
@@ -13,10 +13,7 @@ RUN CMAKE_ARGS="-DUSE_INSTALLED_POCKETSPHINX=ON" pip wheel -v .
FROM runtime
COPY --from=build /usr/local/ /usr/local/
COPY --from=build /pocketsphinx/*.whl /
RUN pip install /*.whl && rm /*.whl
RUN pip install --break-system-packages /*.whl && rm /*.whl
RUN adduser -u 1000 -DHD pocketsphinx && adduser pocketsphinx audio
COPY examples/ /work/examples/
RUN chown -R pocketsphinx:pocketsphinx /work
USER pocketsphinx
WORKDIR /work