- POST /api/v1/auth/register with mandatory consents
- POST /api/v1/auth/login
- GET /api/v1/me (protected)
- GET /api/v1/legal/{terms,privacy,disclaimer}
- Migrations for users, consent_log, audit_log
- bcrypt + JWT (access + refresh)
- Docker Compose stack
29 lines
603 B
Docker
29 lines
603 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 go.sum* ./
|
|
RUN go mod download || 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"]
|