-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
20 lines (17 loc) · 726 Bytes
/
Dockerfile
File metadata and controls
20 lines (17 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Build stage
FROM golang:latest AS builder
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 go build -ldflags="-w -s" -o chough ./cmd/chough
# Runtime stage
FROM debian:stable-slim
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg ca-certificates && rm -rf /var/lib/apt/lists/*
# Copy binary and libraries to /opt/chough/
# Binary has rpath=$ORIGIN, so it looks for libs in same directory
COPY --from=builder /build/chough /opt/chough/
COPY --from=builder /go/pkg/mod/github.com/k2-fsa/sherpa-onnx-go-linux@v1.12.26/lib/x86_64-unknown-linux-gnu/*.so /opt/chough/
EXPOSE 8080
ENTRYPOINT ["/opt/chough/chough"]
CMD ["--server", "--host", "0.0.0.0", "--port", "8080"]