- POST /api/v1/reviews (one per chat_id, UNIQUE) - GET /api/v1/users/:id/reviews (public list) - GET /api/v1/users/:id/stats (rating_avg, count) - migration 0004: reviews (rating 1-5, anonymous flag), user_stats aggregate - only chat participants can review; reviewed_id is other party
31 lines
620 B
Docker
31 lines
620 B
Docker
# syntax=docker/dockerfile:1
|
|
FROM golang:1.22-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# dependencies
|
|
RUN apk add --no-cache git ca-certificates
|
|
|
|
COPY go.mod ./
|
|
COPY go.sum* ./
|
|
RUN go mod download || true
|
|
RUN go mod tidy
|
|
|
|
COPY . .
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /buhapp-api ./cmd/server
|
|
|
|
# ---
|
|
FROM alpine:3.20
|
|
|
|
RUN apk add --no-cache ca-certificates tzdata && \
|
|
addgroup -g 1000 buhapp && adduser -D -u 1000 -G buhapp buhapp
|
|
|
|
WORKDIR /app
|
|
COPY --from=builder /buhapp-api /app/buhapp-api
|
|
COPY --from=builder /app/migrations /app/migrations
|
|
|
|
USER buhapp
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["/app/buhapp-api"]
|