Files
dependabot[bot] 710ce19adb chore(docker): bump alpine from 3.23 to 3.24 (#18)
Bumps alpine from 3.23 to 3.24.

---
updated-dependencies:
- dependency-name: alpine
  dependency-version: '3.24'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-18 22:47:24 +02:00

35 lines
756 B
Docker

# Build stage
FROM golang:1.26-alpine AS builder
RUN apk add --no-cache git ca-certificates
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG TARGETOS=linux
ARG TARGETARCH=amd64
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
-ldflags="-s -w" \
-o /build/vaultwarden-api \
./cmd/api
# Runtime stage — pure Alpine, no Node.js
FROM alpine:3.24
RUN apk --no-cache add ca-certificates wget && \
adduser -D -H appuser
WORKDIR /app
COPY --from=builder /build/vaultwarden-api .
USER appuser
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health || exit 1
ENTRYPOINT ["/app/vaultwarden-api"]