-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (31 loc) · 1.18 KB
/
Copy pathDockerfile
File metadata and controls
49 lines (31 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# ---- Stage 1: Web UI ------------------------------------------------
FROM --platform=$BUILDPLATFORM node:22-alpine AS web-builder
WORKDIR /src/web-src
COPY web-src/package.json web-src/package-lock.json ./
RUN npm ci
COPY web-src/ ./
RUN npx vite build --outDir ../web
# ---- Stage 2: Go binary ---------------------------------------------
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.6.1 AS xx
FROM --platform=$BUILDPLATFORM golang:1.26-alpine3.23 AS go-builder
COPY --from=xx / /
ARG TARGETPLATFORM
RUN xx-info env
ENV CGO_ENABLED=0
ENV XX_VERIFY_STATIC=1
WORKDIR /src
COPY . .
# Inject pre-built web assets
COPY --from=web-builder /src/web/ web/
ARG VERSION=0.0.0-dev
RUN xx-go build -ldflags "-s -w -X github.com/go-gost/wisper/version.Version=${VERSION}" && \
xx-verify wisper
# ---- Stage 3: Runtime -----------------------------------------------
FROM alpine:3.23
COPY --from=go-builder /src/wisper /usr/local/bin/wisper
EXPOSE 8900
VOLUME ["/root/.config/wisper"]
# Log to stderr so `docker logs` works out of the box. It is an env default, not
# an entrypoint arg, so `-e WISPER_LOG_OUTPUT=...` and `-log.output` both win.
ENV WISPER_LOG_OUTPUT=stderr
ENTRYPOINT ["wisper"]