FROM golang:1.26-alpine AS build

ARG SERVICE
WORKDIR /src
COPY services/go.mod ./
COPY services ./
RUN go build -o /out/service ./cmd/${SERVICE}

FROM alpine:3.22

RUN adduser -D app
USER app
WORKDIR /app
COPY --from=build /out/service /app/service
EXPOSE 8080
CMD ["/app/service"]
