# Docker compose example: https://docs.docker.com/guides/walkthroughs/multi-container-apps/

FROM golang:1.22 as build
WORKDIR /app
# copy only dependency related files in a first step to enable incremental build / improve performance
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# CGO_ENABLED flag decides, if static or dynamic C libs should be used. 0 = static, 1 = dynamic.
# As no dynamic C libs are available at runtime, static ones will be used in the resulting binary.
RUN CGO_ENABLED=0 go build -o /bin/xoxoApp

FROM alpine:3.19.1
COPY --from=build /bin/xoxoApp /bin/xoxoApp
CMD ["/bin/xoxoApp"]