FROM golang:1.22-alpine AS builder WORKDIR /src COPY go.mod go.sum* ./ RUN go mod download COPY . . RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/file-service ./cmd/file-service FROM alpine:3.19 RUN apk --no-cache add ca-certificates tzdata && adduser -D -u 10002 app WORKDIR /app COPY --from=builder /out/file-service /app/file-service USER app EXPOSE 8082 ENTRYPOINT ["/app/file-service"]