You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
513 B
Docker

FROM golang:1.25-alpine AS builder
WORKDIR /src
COPY backend ./backend
RUN cd backend/services/question-bank-service && go mod download && CGO_ENABLED=0 GOOS=linux go build -o /out/app ./cmd/main.go
FROM alpine:3.21
RUN apk add --no-cache ca-certificates wget && adduser -D -H -u 10001 app
WORKDIR /app
COPY --from=builder /out/app /app/app
EXPOSE 8081
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=5 CMD wget -qO- http://127.0.0.1:8081/health || exit 1
USER app
ENTRYPOINT ["/app/app"]