forked from cmusphinx/pocketsphinx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
22 lines (18 loc) · 725 Bytes
/
Dockerfile
File metadata and controls
22 lines (18 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM alpine:latest as runtime
RUN apk add --no-cache python3 py3-pip sox
FROM runtime as build
RUN apk add --no-cache cmake ninja gcc musl-dev python3-dev pkgconfig
COPY . /pocketsphinx
WORKDIR /pocketsphinx
RUN cmake -S . -B build -DBUILD_SHARED_LIBS=ON -G Ninja && cmake --build build --target install
# Cannot use --build-option because pip sucks
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 adduser -u 1000 -DHD pocketsphinx && adduser pocketsphinx audio
COPY examples/ /work/examples/
RUN chown -R pocketsphinx:pocketsphinx /work
USER pocketsphinx
WORKDIR /work