Skip to content

Commit 6d8b4f2

Browse files
committed
Updated dockerfile
1 parent 80e13ad commit 6d8b4f2

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

cmd/whisper/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type CLI struct {
2828
Globals
2929
Models ModelsCmd `cmd:"models" help:"List models"`
3030
Download DownloadCmd `cmd:"download" help:"Download a model"`
31-
Server ServerCmd `cmd:"models" help:"Run the whisper server"`
31+
Server ServerCmd `cmd:"server" help:"Run the whisper server"`
3232
}
3333

3434
func main() {

etc/Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ RUN make -j$(nproc)
3535
# Setup runtime container
3636
FROM ${BASE_RUN_CONTAINER} AS runtime
3737
COPY --from=build --chmod=755 /app/build/whisper /usr/local/bin/whisper
38+
COPY --from=build /app/build/whisper /usr/local/bin/whisper
39+
COPY --chmod=755 etc/entrypoint.sh .
3840

39-
# Expose
40-
ENTRYPOINT [ "/usr/local/bin/whisper" ]
41-
CMD [ "server", "--dir=/data" ]
41+
# Entrypoint when running the server
42+
ENTRYPOINT [ "/entrypoint.sh" ]
43+
STOPSIGNAL SIGQUIT
44+
EXPOSE 80
45+
CMD [ "/usr/local/bin/whisper", "-dir", "/data", "-listen", ":80", "server" ]

etc/entrypoint.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
if [ -z "$1" ]; then
4+
echo "No command specified"
5+
exit 1
6+
fi
7+
8+
# Create the /alloc/logs folder if it doesn't exist
9+
install -d -m 0755 /alloc/logs || exit 1
10+
11+
# Create the persistent data folder if it doesn't exist
12+
install -d -m 0755 /data || exit 1
13+
14+
# Run the command
15+
set -e
16+
umask 022
17+
exec "$@"

0 commit comments

Comments
 (0)