Skip to content

Commit

Permalink
fix: run as root in dockerfile so audio can work
Browse files Browse the repository at this point in the history
  • Loading branch information
dhdaines committed Dec 28, 2023
1 parent 0f1f7a4 commit acae2e1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

0 comments on commit acae2e1

Please sign in to comment.