FROM golang:1.24.3-alpine AS build-stage

WORKDIR /app

COPY . .

RUN apk update && \
    apk upgrade && \
    apk add binutils && \
    go mod tidy && \
    go build && \
    strip auth_service
FROM alpine:latest AS build-release-stage

WORKDIR /data

COPY --from=build-stage /app/auth_service /auth_service
COPY users.json /data/users.json
COPY auth_service.config /data/auth_service.config

ENTRYPOINT [ "/auth_service" ]