FROM golang:latest as builder

WORKDIR /app

COPY ../go.mod ../go.sum ./

ARG PAT
RUN if [ -n "$PAT" ] ; then echo "[url \"https://$PAT:x-oauth-basic@github.com/\"] insteadOf = https://github.com/" >> /root/.gitconfig ; fi

ENV GOPRIVATE=github.com/AlchemyTelcoSolutions/*
RUN go mod download
