Some checks failed
CI / Backend (push) Successful in 29s
CI / UI (push) Successful in 27s
Release / Test backend (push) Successful in 37s
CI / Backend (pull_request) Failing after 11s
Release / Check ui (push) Successful in 49s
Release / Docker / caddy (push) Successful in 57s
CI / UI (pull_request) Successful in 56s
Release / Docker / runner (push) Failing after 1m22s
Release / Docker / backend (push) Failing after 1m46s
Release / Docker / ui (push) Successful in 2m25s
Release / Gitea Release (push) Has been skipped
handlePresignVoiceSample generates voice samples on demand via pocket-tts, which requires WAV→MP3 transcoding via ffmpeg. The backend was using distroless/static (no ffmpeg) so all pocket-tts preview requests returned 500. Switch backend stage to Alpine + ffmpeg, matching the runner image.
53 lines
2.3 KiB
Docker
53 lines
2.3 KiB
Docker
# syntax=docker/dockerfile:1
|
|
FROM golang:1.26.1-alpine AS builder
|
|
WORKDIR /app
|
|
|
|
# Download modules into the BuildKit cache so they survive across builds.
|
|
# This layer is only invalidated when go.mod or go.sum changes.
|
|
COPY go.mod go.sum ./
|
|
RUN --mount=type=cache,target=/root/go/pkg/mod \
|
|
go mod download
|
|
|
|
COPY . .
|
|
|
|
ARG VERSION=dev
|
|
ARG COMMIT=unknown
|
|
|
|
# Build all three binaries in a single layer so the Go compiler can reuse
|
|
# intermediate object files. Both cache mounts are preserved between builds:
|
|
# /root/go/pkg/mod — downloaded module source
|
|
# /root/.cache/go-build — compiled package objects (incremental recompile)
|
|
RUN --mount=type=cache,target=/root/go/pkg/mod \
|
|
--mount=type=cache,target=/root/.cache/go-build \
|
|
CGO_ENABLED=0 GOOS=linux go build \
|
|
-ldflags="-s -w -X main.version=${VERSION} -X main.commit=${COMMIT}" \
|
|
-o /out/backend ./cmd/backend && \
|
|
CGO_ENABLED=0 GOOS=linux go build \
|
|
-ldflags="-s -w -X main.version=${VERSION} -X main.commit=${COMMIT}" \
|
|
-o /out/runner ./cmd/runner && \
|
|
CGO_ENABLED=0 GOOS=linux go build \
|
|
-ldflags="-s -w" \
|
|
-o /out/healthcheck ./cmd/healthcheck
|
|
|
|
# ── backend service ──────────────────────────────────────────────────────────
|
|
# Uses Alpine (not distroless) so ffmpeg is available for on-demand voice
|
|
# sample generation via pocket-tts (WAV→MP3 transcoding).
|
|
FROM alpine:3.21 AS backend
|
|
RUN apk add --no-cache ffmpeg ca-certificates && \
|
|
addgroup -S appgroup && adduser -S appuser -G appgroup
|
|
COPY --from=builder /out/healthcheck /healthcheck
|
|
COPY --from=builder /out/backend /backend
|
|
USER appuser
|
|
ENTRYPOINT ["/backend"]
|
|
|
|
# ── runner service ───────────────────────────────────────────────────────────
|
|
# Uses Alpine (not distroless) so ffmpeg is available for WAV→MP3 transcoding
|
|
# when pocket-tts voices are used.
|
|
FROM alpine:3.21 AS runner
|
|
RUN apk add --no-cache ffmpeg ca-certificates && \
|
|
addgroup -S appgroup && adduser -S appuser -G appgroup
|
|
COPY --from=builder /out/healthcheck /healthcheck
|
|
COPY --from=builder /out/runner /runner
|
|
USER appuser
|
|
ENTRYPOINT ["/runner"]
|